areas) ->addColumn('options', function ($model) { return View::make('partials.area', compact('model'))->render(); }) ->make(true); } /** * Display a listing of the resource. * * @return Response */ public function index(Place $place) { return view('area.index', compact('place')); } /** * Show the form for creating a new resource. * * @return Response */ public function create(Place $place) { return view('area.create', compact('place')); } /** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request, Place $place) { $this->validate($request, ['name' => 'required']); $place->areas()->save(new Area($request->all())); return redirect()->route('admin.place.area.index', $place); } /** * Display the specified resource. * * @param int $id * @return Response */ public function show(Place $place, Area $area) { return view('area.show', compact('place', 'area')); } /** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit(Place $place, Area $area) { return view('area.edit', compact('place', 'area')); } /** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Request $request, Place $place, Area $area) { $this->validate($request, ['name' => 'required']); $area->update($request->all()); return redirect()->route('admin.place.area.index', $place); } /** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(Place $place, Area $area) { $area->delete(); } }