/**
  * Mass delete function from index page
  * @param Request $request
  *
  * @return mixed
  */
 public function massDelete(Request $request)
 {
     if ($request->get('toDelete') != 'mass') {
         $toDelete = json_decode($request->get('toDelete'));
         TopMenus::destroy($toDelete);
     } else {
         TopMenus::whereNotNull('id')->delete();
     }
     return redirect()->route('admin.topmenus.index');
 }
Esempio n. 2
0
 public static function boot()
 {
     parent::boot();
     TopMenus::observe(new UserActionsObserver());
 }