2015-07-12 21:01:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2015-07-27 21:17:08 +02:00
|
|
|
|
2015-08-05 21:59:39 +02:00
|
|
|
// Authentication routes...
|
|
|
|
Route::group(['middleware' => 'auth'], function() {
|
|
|
|
|
|
|
|
Route::group(['prefix' => 'books'], function() {
|
|
|
|
|
|
|
|
Route::get('/', 'BookController@index');
|
|
|
|
Route::get('/create', 'BookController@create');
|
|
|
|
Route::post('/', 'BookController@store');
|
|
|
|
Route::get('/{slug}/edit', 'BookController@edit');
|
|
|
|
Route::put('/{slug}', 'BookController@update');
|
|
|
|
Route::delete('/{id}', 'BookController@destroy');
|
|
|
|
Route::get('/{slug}', 'BookController@show');
|
|
|
|
Route::get('/{slug}/delete', 'BookController@showDelete');
|
|
|
|
|
|
|
|
Route::get('/{bookSlug}/page/create', 'PageController@create');
|
|
|
|
Route::post('/{bookSlug}/page', 'PageController@store');
|
|
|
|
Route::get('/{bookSlug}/sort', 'PageController@sortPages');
|
|
|
|
Route::put('/{bookSlug}/sort', 'PageController@savePageSort');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete');
|
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
|
|
|
|
Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy');
|
|
|
|
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create');
|
|
|
|
Route::get('/{bookSlug}/chapter/create', 'ChapterController@create');
|
|
|
|
Route::post('/{bookSlug}/chapter/create', 'ChapterController@store');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show');
|
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
|
|
|
|
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
Route::post('/upload/image', 'ImageController@upload');
|
|
|
|
|
2015-08-08 21:05:30 +02:00
|
|
|
// Users
|
|
|
|
Route::get('/users', 'UserController@index');
|
|
|
|
Route::get('/users/create', 'UserController@create');
|
|
|
|
Route::get('/users/{id}/delete', 'UserController@delete');
|
|
|
|
Route::post('/users/create', 'UserController@store');
|
|
|
|
Route::get('/users/{id}', 'UserController@edit');
|
|
|
|
Route::put('/users/{id}', 'UserController@update');
|
|
|
|
Route::delete('/users/{id}', 'UserController@destroy');
|
|
|
|
|
|
|
|
// Image routes
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/images/all', 'ImageController@getAll');
|
|
|
|
Route::get('/images/all/{page}', 'ImageController@getAll');
|
|
|
|
Route::get('/images/{any}', 'ImageController@getImage')->where('any', '.*');
|
2015-07-12 21:01:42 +02:00
|
|
|
|
2015-08-08 21:05:30 +02:00
|
|
|
// Links
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
2015-08-08 21:05:30 +02:00
|
|
|
|
|
|
|
// Search
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/pages/search/all', 'PageController@searchAll');
|
2015-07-13 22:52:56 +02:00
|
|
|
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/', function () {
|
|
|
|
return view('base');
|
|
|
|
});
|
2015-07-13 22:52:56 +02:00
|
|
|
|
2015-07-16 20:15:22 +02:00
|
|
|
|
2015-07-12 21:01:42 +02:00
|
|
|
});
|
2015-08-05 22:16:10 +02:00
|
|
|
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/login', 'Auth\AuthController@getLogin');
|
|
|
|
Route::post('/login', 'Auth\AuthController@postLogin');
|
|
|
|
Route::get('/logout', 'Auth\AuthController@getLogout');
|