Example #1
0
 public function getCastDetails()
 {
     if (Request::ajax()) {
         $data = Request::all();
         $cast_id = $data['cast_id'];
         return Cast::find($cast_id);
     }
 }
 public function query(Request $request, $id)
 {
     $cast = Cast::find($id);
     $cast->movies()->sync($request->data);
     return;
 }
Example #3
0
 /**
  *
  * Modal window, delete role
  * @param array $request
  * @return Response
  *
  */
 public function removeMovieRole()
 {
     if ($this->isAdmin) {
         if (Request::ajax()) {
             $data = Request::all();
             $cast_id = $data['movie'];
             $person_id = $data['person'];
             $person = Persons::findorfail($person_id);
             Cast::find($cast_id)->delete();
             return (string) view('people.roles', compact('person'));
         }
     }
     return "error";
 }
Example #4
0
 /**
  *
  * Remove cast member from movie
  * @return Response
  *
  */
 public function removeCastMember()
 {
     if ($this->isAdmin) {
         if (Request::ajax()) {
             $data = Request::all();
             $movie_id = $data['movie'];
             $cast_id = $data['row'];
             $movie = Movies::findorfail($movie_id);
             Cast::find($cast_id)->delete();
             return (string) view('movies.cast', compact('movie'));
         }
     }
     return "error";
 }