/** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { //This check is rather redundant since we tackle this problem already in the create & edit functions if (isMakerOfSeries($this->id, Auth::id())) { return true; } else { return false; } }
public function createExercise($id) { if (!isMakerOfSeries($id, Auth::id())) { flash()->error('You must be logged in as the maker of this series in order to add exercises.')->important(); return redirect('series/' . $id); } $serie = loadSerieWithId($id)[0]; return view('exercises.create', compact('serie')); }