I tried deleting records by id, but it happens, I have found the last record is deleted,
//Index method just
Report::all( ) ;
//Delete mesthod
Report::delete($id);
sorry if very quick question, I use a mobile phone now Thank You
I tried deleting records by id, but it happens, I have found the last record is deleted,
//Index method just
Report::all( ) ;
//Delete mesthod
Report::delete($id);
sorry if very quick question, I use a mobile phone now Thank You
According to the docs, one should find the specific record with a query and perform delete on that.
https://laravel.com/docs/5.3/eloquent#deleting-models
Based on their example your code should be more like: