public function get_index() { $this->data['news'] = News::order_by('created_at', 'desc')->get(); return View::make('admin.' . $this->views . '.index', $this->data); }
| Route::post(array('hello', 'world'), function() | { | return 'Hello World!'; | }); | | It's easy to allow URI wildcards using (:num) or (:any): | | Route::put('hello/(:any)', function($name) | { | return "Welcome, $name."; | }); | */ Route::get(array('/', 'home', 'sup', 'bro'), function () { if (Auth::check()) { return View::make('page.user_home')->with('news', News::order_by('created_at', 'DESC')->paginate(4)); } return View::make('page.user.login'); }); /* |-------------------------------------------------------------------------- | Application 404 & 500 Error Handlers |-------------------------------------------------------------------------- | | To centralize and simplify 404 handling, Laravel uses an awesome event | system to retrieve the response. Feel free to modify this function to | your tastes and the needs of your application. | | Similarly, we use an event to handle the display of 500 level errors | within the application. These errors are fired when there is an | uncaught exception thrown in the application.
public function get_overview() { return View::make('page.admin.news.overview')->with('news', News::order_by('created_at', 'DESC')->paginate(25)); }