Пример #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Paper  $paper
  * @param  Department $department
  * @return \Illuminate\Http\Response
  */
 public function destroy(Department $department, Paper $paper)
 {
     if ($paper->canEdit()) {
         $this->paper->setPaper($paper);
         if (!$this->paper->delete()) {
             return redirect()->back()->with('error', 'error-delete-paper');
         }
         return redirect()->action('PaperController@index', [$department->keyword])->with('success', 'paper-deleted');
     }
     return redirect()->back()->with('error', 'access-denied');
 }