2015-07-12 21:01:42 +02:00
|
|
|
<?php
|
|
|
|
|
2015-08-30 12:47:58 +02:00
|
|
|
// Authenticated routes...
|
2015-08-29 16:03:42 +02:00
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
2015-08-05 21:59:39 +02:00
|
|
|
|
2015-08-29 16:03:42 +02:00
|
|
|
Route::group(['prefix' => 'books'], function () {
|
2015-08-05 21:59:39 +02:00
|
|
|
|
2015-08-09 13:06:52 +02:00
|
|
|
// Books
|
2015-08-05 21:59:39 +02:00
|
|
|
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');
|
2015-09-06 15:35:53 +02:00
|
|
|
Route::get('/{slug}/sort-item', 'BookController@getSortItem');
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/{slug}', 'BookController@show');
|
|
|
|
Route::get('/{slug}/delete', 'BookController@showDelete');
|
2015-09-06 15:35:53 +02:00
|
|
|
Route::get('/{bookSlug}/sort', 'BookController@sort');
|
|
|
|
Route::put('/{bookSlug}/sort', 'BookController@saveSort');
|
|
|
|
|
2015-08-05 21:59:39 +02:00
|
|
|
|
2015-08-09 13:06:52 +02:00
|
|
|
// Pages
|
2015-08-05 21:59:39 +02:00
|
|
|
Route::get('/{bookSlug}/page/create', 'PageController@create');
|
|
|
|
Route::post('/{bookSlug}/page', 'PageController@store');
|
|
|
|
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');
|
2015-08-30 12:47:58 +02:00
|
|
|
|
2015-08-09 13:06:52 +02:00
|
|
|
//Revisions
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions', 'PageController@showRevisions');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', 'PageController@showRevision');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', 'PageController@restoreRevision');
|
2015-08-05 21:59:39 +02:00
|
|
|
|
2015-08-09 13:06:52 +02:00
|
|
|
// Chapters
|
2015-08-05 21:59:39 +02:00
|
|
|
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');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
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-12-08 00:00:34 +01:00
|
|
|
Route::group(['prefix' => 'images'], function() {
|
|
|
|
Route::get('/gallery/all', 'ImageController@getAllGallery');
|
|
|
|
Route::get('/gallery/all/{page}', 'ImageController@getAllGallery');
|
|
|
|
Route::post('/gallery/upload', 'ImageController@uploadGallery');
|
|
|
|
Route::put('/update/{imageId}', 'ImageController@update');
|
|
|
|
Route::delete('/{imageId}', 'ImageController@destroy');
|
|
|
|
});
|
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-31 21:11:44 +02:00
|
|
|
Route::get('/search/all', 'SearchController@searchAll');
|
2015-09-01 16:35:11 +02:00
|
|
|
Route::get('/search/book/{bookId}', 'SearchController@searchBook');
|
2015-07-13 22:52:56 +02:00
|
|
|
|
2015-08-16 21:11:21 +02:00
|
|
|
// Other Pages
|
|
|
|
Route::get('/', 'HomeController@index');
|
|
|
|
Route::get('/home', 'HomeController@index');
|
2015-07-13 22:52:56 +02:00
|
|
|
|
2015-08-30 16:31:16 +02:00
|
|
|
// Settings
|
|
|
|
Route::get('/settings', 'SettingController@index');
|
|
|
|
Route::post('/settings', 'SettingController@update');
|
|
|
|
|
2015-07-12 21:01:42 +02:00
|
|
|
});
|
2015-08-05 22:16:10 +02:00
|
|
|
|
2015-09-04 21:40:36 +02:00
|
|
|
// Login using social authentication
|
|
|
|
Route::get('/login/service/{socialDriver}', 'Auth\AuthController@getSocialLogin');
|
|
|
|
Route::get('/login/service/{socialDriver}/callback', 'Auth\AuthController@socialCallback');
|
|
|
|
Route::get('/login/service/{socialDriver}/detach', 'Auth\AuthController@detachSocialAccount');
|
|
|
|
|
2015-08-23 16:46:02 +02:00
|
|
|
// Login/Logout routes
|
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');
|
2015-09-05 18:42:05 +02:00
|
|
|
Route::get('/register', 'Auth\AuthController@getRegister');
|
2015-09-05 21:25:57 +02:00
|
|
|
Route::get('/register/confirm', 'Auth\AuthController@getRegisterConfirmation');
|
|
|
|
Route::get('/register/confirm/awaiting', 'Auth\AuthController@showAwaitingConfirmation');
|
|
|
|
Route::post('/register/confirm/resend', 'Auth\AuthController@resendConfirmation');
|
|
|
|
Route::get('/register/confirm/{token}', 'Auth\AuthController@confirmEmail');
|
2015-09-21 21:54:11 +02:00
|
|
|
Route::get('/register/confirm/{token}/email', 'Auth\AuthController@viewConfirmEmail');
|
2015-09-06 13:14:32 +02:00
|
|
|
Route::get('/register/service/{socialDriver}', 'Auth\AuthController@socialRegister');
|
2015-09-05 21:25:57 +02:00
|
|
|
Route::post('/register', 'Auth\AuthController@postRegister');
|
2015-09-04 18:16:58 +02:00
|
|
|
|
2015-08-23 16:46:02 +02:00
|
|
|
// Password reset link request routes...
|
|
|
|
Route::get('/password/email', 'Auth\PasswordController@getEmail');
|
|
|
|
Route::post('/password/email', 'Auth\PasswordController@postEmail');
|
|
|
|
// Password reset routes...
|
|
|
|
Route::get('/password/reset/{token}', 'Auth\PasswordController@getReset');
|
|
|
|
Route::post('/password/reset', 'Auth\PasswordController@postReset');
|