Exemplo n.º 1
0
<?php

use Carbon\Carbon;
use App\Giftlist;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    $lists = Giftlist::orderBy('created_at', 'desc')->paginate(10);
    return view('welcome')->with('lists', $lists);
});
//Route::get('admin', function() {
//	return view('admin');
//});
Route::resource('lists', 'GiftlistsController');
Route::resource('gifts', 'GiftsController');
Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
    Route::resource('lists', 'GiftlistsController');
    Route::resource('gifts', 'GiftsController');
    Route::get('/', function () {
        return view('admin');
    });
});
// Just random testing - not sure how this handles midnight cross-over
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $lists = Giftlist::orderBy('created_at', 'desc')->paginate(10);
     return view('admin.lists.index')->with('lists', $lists);
 }