コード例 #1
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index($page = null)
 {
     $page = isset($page) ? 'bootstrap' : 'index';
     // get all the Slider
     $sliders = Slider::all();
     // get all the Contact
     $contacts = Contact::all();
     // get all the Project_image
     $project_images = Project_image::orderBy('position')->get();
     // get all the Projects
     $projects = Project::orderBy('position')->get();
     // get all the service_details
     $service_details = Service_detail::orderBy('position')->get();
     // get all the services
     $services = Service::orderBy('position')->get();
     // get all the menus
     $menus = Menu::orderBy('position')->get();
     // load the view and pass the menus
     // load the view and pass the services
     return \View::make($page)->with('sliders', $sliders)->with('contacts', $contacts)->with('project_images', $project_images)->with('projects', $projects)->with('service_details', $service_details)->with('services', $services)->with('menus', $menus);
 }
コード例 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //only 4
     exit;
     // delete
     $service = Service::find($id);
     $service->delete();
     // redirect
     \Session::flash('message', 'Successfully deleted the service!');
     return \Redirect::to('admin/services');
 }
コード例 #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $service_detail = Service_detail::find($id);
     // get the service
     $service = Service::find($service_detail->service_id);
     // delete
     $service_detail->delete();
     // redirect
     \Session::flash('message', 'Successfully deleted the service_detail!');
     return \Redirect::to("admin/service_details/{$service->id}");
 }