/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $project_image = Project_image::find($id); // get the project $project = Project::find($project_image->project_id); // delete $project_image->delete(); // redirect \Session::flash('message', 'Successfully deleted the project_image!'); return \Redirect::to("admin/project_images/{$project->id}"); }