Esempio n. 1
0
Route::controllers(['password' => 'Auth\\PasswordController']);
//Route to Confirm Login worked!
Route::get('/confirm-login-worked', function () {
    $user = Auth::user();
    if ($user) {
        echo 'You are logged in.';
        dump($user->toArray());
    } else {
        echo 'You are not logged in.';
    }
    return;
});
//setup search
Route:
get('/books/search', function () {
    $books = \App\Book::all();
    return view('books/search')->with('books', $books);
});
Route::get('/search/rating', function () {
    $books = \App\Book::all();
    $ratings = \App\Rating::all();
    return view('books/search/rating')->with('books', $books)->with('ratings', $ratings);
});
Route::resource('books', 'BookController');
Route::resource('book', 'BookController');
Route::post('/books/search', 'BookController@search');
Route::post('/books/edit/submit', 'BookController@edited');
Route::post('/books/{id}', 'BookController@comment');
//Route::post('/books/{id}', 'BookController@rating');
Route::get('/books/{id}/delete', 'BookController@delete');
Route::get('/books/{id?}/confirm_delete/', 'BookController@getConfirmDelete');