Beispiel #1
0
    BookController::firstPageBooks();
});
$routes->post('/', function () {
    ReaderController::logout();
});
$routes->get('/allbooks', function () {
    BookController::listingBooks();
});
$routes->post('/allbooks', function () {
    BookController::store();
});
$routes->get('/allbooks/new', 'check_admin_logged', function () {
    BookController::create();
});
$routes->get('/allbooks/:id', function ($id) {
    BookController::gettingDetails($id);
});
$routes->get('/allbooks/:id/edit', 'check_admin_logged', function ($id) {
    BookController::showEditForm($id);
});
$routes->post('/allbooks/:id/edit', 'check_admin_logged', function ($id) {
    BookController::updateBook($id);
});
$routes->post('/allbooks/:id/delete', 'check_admin_logged', function ($id) {
    //
    BookController::deleteBook($id);
});
$routes->post('/allbooks/:id/add', 'check_user_logged_in', function ($id) {
    ReaderController::addBookToUser($id);
});
$routes->get('/login', function () {