/** * Display a listing of the resource. * * @return Response */ public function index() { // Get all the entries $entries = Entry::all()->sortByDesc(function ($entry) { return $entry->updated_at; }, SORT_REGULAR); // Initialise view parameters $params = ['title' => 'All Entries', 'entries' => $entries]; // Return the rendered view return view('blog.entry.index', $params); }
public function dashboard() { $entries = Entry::all(); return view('admin.dashboard', compact('entries')); }
public function index() { $entries = Entry::all(); return view('entry/index', compact('entries', $entries)); }
public function testDummy() { factory(\App\Entry::class, 5)->create(); $this->assertEquals(5, \App\Entry::all()->count()); }
/** * Show all entries * * Get a JSON representation of all the registered users. * * @Get("/") * @Versions({"v1"}) */ public function index() { return Entry::all()->toArray(); }
<?php /** * */ use App\User; use App\Entry; use App\Comment; // The following routes serve the nav bar //////////////////////////////////////// // Default route ... to the Blog! Route::get('/', function () { // Get all the entries $entries = Entry::all()->sortByDesc(function ($entry) { return $entry->updated_at; }); // Return the view rendered with all the entries return view('blog', ['entries' => $entries]); }); // About route... Route::get('about', function () { return view('about'); }); // Authentication routes... // Login... Route::get('/auth/login', 'Auth\\AuthController@getLogin'); Route::post('/auth/login', 'Auth\\AuthController@postLogin'); // Logout... Route::get('/auth/logout', 'Auth\\AuthController@getLogout'); // TOD Registration routes... //Route::get('/auth/register', 'Auth\AuthController@getRegister');