예제 #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);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     // delete
     $slider = Slider::find($id);
     $slider->delete();
     // redirect
     \Session::flash('message', 'Successfully deleted the slider!');
     return \Redirect::to('admin/sliders');
 }