vendredi 20 mai 2016

i am trying make function

i am trying make function with Laravel 5 for deleting as general function i am passing two parameters , first id of post and second the name of class that i wanna delete from, but when i call this function dosnot recognize the the name of class enter image description here

and when i put the name manual its work and this the function

public function Delete($id,$object){
$single=$object::find($id);    
$single->delete();
  Session::flash('sucess','تم تحديث البيانات بنجاح');   
return redirect()->back();   
}

and this the route

enter code here



Route::get('/Delete/{id}/{object}', [
    'uses'=>'admin@Delete',
    'as'=>'Delete'
] 

); 

and this the link

<a href=""> </a>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/256lAn8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire