コード例 #1
0
 /**
  * Remove the specified artist from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if (Auth::check() && Auth::user()->hasOnePrivelege(['Administrator'])) {
         $artist = Artist::findOrFail($id);
         if (Input::get('delete') == "delete") {
             $artist->delete();
         } elseif (Input::get('delete') == "deleteAll") {
             $artworks = Artwork::where('artist', $id)->delete();
             $artist->delete();
         } else {
         }
         return redirect('/artists');
     } else {
         return View::make('errors/' . HttpCode::Unauthorized);
     }
 }