예제 #1
0
 public function destroy($id)
 {
     $study = Study::find($id);
     if (!$study) {
         abort(404);
     }
     if (count($study->users) > 0) {
         Session::flash('flash_message', "Study '" . $study->name . "' has users associated with it. You cannot remove it.");
         return Redirect::route("study::list");
     }
     Session::flash('flash_message', "Study '" . $study->name . "' has been removed.");
     $study->delete();
     return Redirect::route("study::list");
 }