2015-07-13 03:01:42 +08:00
|
|
|
<?php
|
|
|
|
|
2015-08-30 18:47:58 +08:00
|
|
|
// Authenticated routes...
|
2015-08-29 22:03:42 +08:00
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
2015-08-06 03:59:39 +08:00
|
|
|
|
2016-02-21 02:51:01 +08:00
|
|
|
Route::group(['prefix' => 'pages'], function() {
|
|
|
|
Route::get('/recently-created', 'PageController@showRecentlyCreated');
|
|
|
|
Route::get('/recently-updated', 'PageController@showRecentlyUpdated');
|
|
|
|
});
|
|
|
|
|
2015-08-29 22:03:42 +08:00
|
|
|
Route::group(['prefix' => 'books'], function () {
|
2015-08-06 03:59:39 +08:00
|
|
|
|
2015-08-09 19:06:52 +08:00
|
|
|
// Books
|
2015-08-06 03:59:39 +08: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 21:35:53 +08:00
|
|
|
Route::get('/{slug}/sort-item', 'BookController@getSortItem');
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/{slug}', 'BookController@show');
|
2016-02-28 18:49:41 +08:00
|
|
|
Route::get('/{bookSlug}/restrict', 'BookController@showRestrict');
|
|
|
|
Route::put('/{bookSlug}/restrict', 'BookController@restrict');
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/{slug}/delete', 'BookController@showDelete');
|
2015-09-06 21:35:53 +08:00
|
|
|
Route::get('/{bookSlug}/sort', 'BookController@sort');
|
|
|
|
Route::put('/{bookSlug}/sort', 'BookController@saveSort');
|
|
|
|
|
2015-08-09 19:06:52 +08:00
|
|
|
// Pages
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/{bookSlug}/page/create', 'PageController@create');
|
2016-03-13 20:04:08 +08:00
|
|
|
Route::get('/{bookSlug}/draft/{pageId}', 'PageController@editDraft');
|
|
|
|
Route::post('/{bookSlug}/page/{pageId}', 'PageController@store');
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
|
2016-01-21 06:13:13 +08:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/pdf', 'PageController@exportPdf');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageController@exportHtml');
|
2016-02-01 01:53:30 +08:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageController@exportPlainText');
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete');
|
2016-03-13 20:04:08 +08:00
|
|
|
Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft');
|
2016-02-28 18:49:41 +08:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/restrict', 'PageController@showRestrict');
|
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}/restrict', 'PageController@restrict');
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
|
|
|
|
Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy');
|
2016-03-13 20:04:08 +08:00
|
|
|
Route::delete('/{bookSlug}/draft/{pageId}', 'PageController@destroyDraft');
|
2015-08-30 18:47:58 +08:00
|
|
|
|
2016-01-21 06:13:13 +08:00
|
|
|
// Revisions
|
2015-08-09 19:06:52 +08:00
|
|
|
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-06 03:59:39 +08:00
|
|
|
|
2015-08-09 19:06:52 +08:00
|
|
|
// Chapters
|
2015-08-06 03:59:39 +08: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');
|
2016-02-28 18:49:41 +08:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/restrict', 'ChapterController@showRestrict');
|
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}/restrict', 'ChapterController@restrict');
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
|
|
|
|
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2016-02-17 05:25:11 +08:00
|
|
|
// User Profile routes
|
|
|
|
Route::get('/user/{userId}', 'UserController@showProfilePage');
|
2015-08-09 03:05:30 +08:00
|
|
|
|
|
|
|
// Image routes
|
2015-12-08 07:00:34 +08:00
|
|
|
Route::group(['prefix' => 'images'], function() {
|
2015-12-10 06:30:55 +08:00
|
|
|
// Get for user images
|
|
|
|
Route::get('/user/all', 'ImageController@getAllForUserType');
|
|
|
|
Route::get('/user/all/{page}', 'ImageController@getAllForUserType');
|
2015-12-09 06:04:59 +08:00
|
|
|
// Standard get, update and deletion for all types
|
|
|
|
Route::get('/thumb/{id}/{width}/{height}/{crop}', 'ImageController@getThumbnail');
|
2015-12-08 07:00:34 +08:00
|
|
|
Route::put('/update/{imageId}', 'ImageController@update');
|
2015-12-09 06:04:59 +08:00
|
|
|
Route::post('/{type}/upload', 'ImageController@uploadByType');
|
|
|
|
Route::get('/{type}/all', 'ImageController@getAllByType');
|
|
|
|
Route::get('/{type}/all/{page}', 'ImageController@getAllByType');
|
2015-12-08 07:00:34 +08:00
|
|
|
Route::delete('/{imageId}', 'ImageController@destroy');
|
|
|
|
});
|
2015-07-13 03:01:42 +08:00
|
|
|
|
2016-03-10 06:32:07 +08:00
|
|
|
// Ajax routes
|
2016-03-13 20:04:08 +08:00
|
|
|
Route::put('/ajax/page/{id}/save-draft', 'PageController@saveDraft');
|
2016-03-12 23:52:19 +08:00
|
|
|
Route::get('/ajax/page/{id}', 'PageController@getPageAjax');
|
2016-03-13 20:04:08 +08:00
|
|
|
Route::delete('/ajax/page/{id}', 'PageController@ajaxDestroy');
|
2016-03-10 06:32:07 +08:00
|
|
|
|
2015-08-09 03:05:30 +08:00
|
|
|
// Links
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
2015-08-09 03:05:30 +08:00
|
|
|
|
|
|
|
// Search
|
2015-09-01 03:11:44 +08:00
|
|
|
Route::get('/search/all', 'SearchController@searchAll');
|
2016-02-21 20:53:58 +08:00
|
|
|
Route::get('/search/pages', 'SearchController@searchPages');
|
|
|
|
Route::get('/search/books', 'SearchController@searchBooks');
|
|
|
|
Route::get('/search/chapters', 'SearchController@searchChapters');
|
2015-09-01 22:35:11 +08:00
|
|
|
Route::get('/search/book/{bookId}', 'SearchController@searchBook');
|
2015-07-14 04:52:56 +08:00
|
|
|
|
2015-08-17 03:11:21 +08:00
|
|
|
// Other Pages
|
|
|
|
Route::get('/', 'HomeController@index');
|
|
|
|
Route::get('/home', 'HomeController@index');
|
2015-07-14 04:52:56 +08:00
|
|
|
|
2015-08-30 22:31:16 +08:00
|
|
|
// Settings
|
2016-02-17 05:25:11 +08:00
|
|
|
Route::group(['prefix' => 'settings'], function() {
|
|
|
|
Route::get('/', 'SettingController@index');
|
|
|
|
Route::post('/', 'SettingController@update');
|
2016-02-27 07:44:02 +08:00
|
|
|
|
2016-02-17 05:25:11 +08: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');
|
2016-02-27 07:44:02 +08:00
|
|
|
|
|
|
|
// Roles
|
|
|
|
Route::get('/roles', 'PermissionController@listRoles');
|
2016-02-28 03:24:42 +08:00
|
|
|
Route::get('/roles/new', 'PermissionController@createRole');
|
|
|
|
Route::post('/roles/new', 'PermissionController@storeRole');
|
|
|
|
Route::get('/roles/delete/{id}', 'PermissionController@showDeleteRole');
|
|
|
|
Route::delete('/roles/delete/{id}', 'PermissionController@deleteRole');
|
2016-02-27 07:44:02 +08:00
|
|
|
Route::get('/roles/{id}', 'PermissionController@editRole');
|
2016-02-28 03:24:42 +08:00
|
|
|
Route::put('/roles/{id}', 'PermissionController@updateRole');
|
2016-02-17 05:25:11 +08:00
|
|
|
});
|
2015-08-30 22:31:16 +08:00
|
|
|
|
2015-07-13 03:01:42 +08:00
|
|
|
});
|
2015-08-06 04:16:10 +08:00
|
|
|
|
2015-09-05 03:40:36 +08: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 22:46:02 +08:00
|
|
|
// Login/Logout routes
|
2015-08-06 03:59:39 +08:00
|
|
|
Route::get('/login', 'Auth\AuthController@getLogin');
|
|
|
|
Route::post('/login', 'Auth\AuthController@postLogin');
|
|
|
|
Route::get('/logout', 'Auth\AuthController@getLogout');
|
2015-09-06 00:42:05 +08:00
|
|
|
Route::get('/register', 'Auth\AuthController@getRegister');
|
2015-09-06 03:25:57 +08: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-22 03:54:11 +08:00
|
|
|
Route::get('/register/confirm/{token}/email', 'Auth\AuthController@viewConfirmEmail');
|
2015-09-06 19:14:32 +08:00
|
|
|
Route::get('/register/service/{socialDriver}', 'Auth\AuthController@socialRegister');
|
2015-09-06 03:25:57 +08:00
|
|
|
Route::post('/register', 'Auth\AuthController@postRegister');
|
2015-09-05 00:16:58 +08:00
|
|
|
|
2015-08-23 22:46:02 +08: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');
|