mercredi 26 juillet 2017

Laravel - Redirect with both data and message

This is my categories list page.

enter image description here

To load this page Controller code is

public function categorysettings(Request $request)
{
  $categorieslist=productcategory::all();
  return view('categorieslist',compact('categorieslist'));
}

now when i click delete button this code is executed.

public function deletecategory($categoryid)
{
   $category = productcategory::find($categoryid);
   $category->delete();
   $categorieslist=productcategory::all();
   return Redirect::back()->with('deleted','Successfully Deleted Category !!!');

}

In my html page i have session names as deleted to display the message. But whenever i click delete button the data gets deleted but it show like this. enter image description here

Any Help or suggestion are most welcome.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire