Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($id = null)
 {
     if ($id == null) {
         //$locations_with_devices = Blogs::with('Employees')->get();
         //return $locations_with_devices;
         /* echo '<pre>';
            print_r($locations_with_devices);
            echo '</pre>';*/
         /*$a = Blog::orderBy('id', 'desc')->get();
           $b = Employee::find($a->user_id);
           echo '<pre>';
           print_r($b);
           echo '</pre>';*/
         //return View('blogs.list');
         //return Blog::orderBy('id', 'desc')->get();
         $blogs = Blog::All();
         return View::make('blogs.list')->with('blogs', $blogs);
     } else {
         return $this->show($id);
     }
 }
Пример #2
0
 public function index()
 {
     $this->data['blog'] = Blog::All('date', 'DESC');
     View::Render('index', $this->data);
 }