コード例 #1
0
ファイル: MarkController.php プロジェクト: Puskice/PuskiceCMS
 public function getDestroy($id)
 {
     if (Session::get('user_level') < Config::get('cms.deleteContacts')) {
         return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning');
     }
     try {
         $mark = Mark::onlyTrashed()->findOrFail($id);
         $mark->forceDelete();
         return Redirect::to(_l(URL::action('MarkController@getTrashed')))->with('message', Lang::get('admin.markDeleted'))->with('notif', 'success');
     } catch (Exception $e) {
         return Redirect::to(_l(URL::action('MarkController@getTrashed')))->with('message', Lang::get('admin.noSuchMark'))->with('notif', 'danger');
     }
 }