2015-07-12 15:01:42 -04:00
|
|
|
<?php
|
|
|
|
|
2017-03-05 09:10:55 -05:00
|
|
|
Route::get('/translations', 'HomeController@getTranslations');
|
2018-02-17 14:49:00 -05:00
|
|
|
Route::get('/icon/{iconName}.svg', 'HomeController@getIcon');
|
2016-12-31 09:27:40 -05:00
|
|
|
|
2015-08-30 06:47:58 -04:00
|
|
|
// Authenticated routes...
|
2015-08-29 10:03:42 -04:00
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
2015-08-05 15:59:39 -04:00
|
|
|
|
2018-01-13 06:11:23 -05:00
|
|
|
Route::get('/uploads/images/{path}', 'ImageController@showImage')
|
|
|
|
->where('path', '.*$');
|
|
|
|
|
2016-02-20 13:51:01 -05:00
|
|
|
Route::group(['prefix' => 'pages'], function() {
|
|
|
|
Route::get('/recently-created', 'PageController@showRecentlyCreated');
|
|
|
|
Route::get('/recently-updated', 'PageController@showRecentlyUpdated');
|
|
|
|
});
|
|
|
|
|
2018-03-25 06:34:42 -04:00
|
|
|
Route::get('/create-book', 'BookController@create');
|
2015-08-29 10:03:42 -04:00
|
|
|
Route::group(['prefix' => 'books'], function () {
|
2015-08-05 15:59:39 -04:00
|
|
|
|
2015-08-09 07:06:52 -04:00
|
|
|
// Books
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/', 'BookController@index');
|
|
|
|
Route::post('/', 'BookController@store');
|
|
|
|
Route::get('/{slug}/edit', 'BookController@edit');
|
|
|
|
Route::put('/{slug}', 'BookController@update');
|
|
|
|
Route::delete('/{id}', 'BookController@destroy');
|
2015-09-06 09:35:53 -04:00
|
|
|
Route::get('/{slug}/sort-item', 'BookController@getSortItem');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{slug}', 'BookController@show');
|
2016-03-30 15:15:44 -04:00
|
|
|
Route::get('/{bookSlug}/permissions', 'BookController@showRestrict');
|
|
|
|
Route::put('/{bookSlug}/permissions', 'BookController@restrict');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{slug}/delete', 'BookController@showDelete');
|
2015-09-06 09:35:53 -04:00
|
|
|
Route::get('/{bookSlug}/sort', 'BookController@sort');
|
|
|
|
Route::put('/{bookSlug}/sort', 'BookController@saveSort');
|
2017-02-26 08:26:51 -05:00
|
|
|
Route::get('/{bookSlug}/export/html', 'BookController@exportHtml');
|
|
|
|
Route::get('/{bookSlug}/export/pdf', 'BookController@exportPdf');
|
|
|
|
Route::get('/{bookSlug}/export/plaintext', 'BookController@exportPlainText');
|
2015-09-06 09:35:53 -04:00
|
|
|
|
2015-08-09 07:06:52 -04:00
|
|
|
// Pages
|
2018-03-25 06:34:42 -04:00
|
|
|
Route::get('/{bookSlug}/create-page', 'PageController@create');
|
|
|
|
Route::post('/{bookSlug}/create-guest-page', 'PageController@createAsGuest');
|
2016-03-13 08:04:08 -04:00
|
|
|
Route::get('/{bookSlug}/draft/{pageId}', 'PageController@editDraft');
|
2016-05-13 16:20:21 -04:00
|
|
|
Route::post('/{bookSlug}/draft/{pageId}', 'PageController@store');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
|
2016-01-20 17:13:13 -05:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/pdf', 'PageController@exportPdf');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageController@exportHtml');
|
2016-01-31 12:53:30 -05:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageController@exportPlainText');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
|
2016-06-11 16:04:18 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/move', 'PageController@showMove');
|
2016-06-12 07:14:14 -04:00
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}/move', 'PageController@move');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete');
|
2016-03-13 08:04:08 -04:00
|
|
|
Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft');
|
2016-03-30 15:15:44 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@showRestrict');
|
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@restrict');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
|
|
|
|
Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy');
|
2016-03-13 08:04:08 -04:00
|
|
|
Route::delete('/{bookSlug}/draft/{pageId}', 'PageController@destroyDraft');
|
2015-08-30 06:47:58 -04:00
|
|
|
|
2016-01-20 17:13:13 -05:00
|
|
|
// Revisions
|
2015-08-09 07:06:52 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions', 'PageController@showRevisions');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', 'PageController@showRevision');
|
2016-09-29 05:10:46 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', 'PageController@showRevisionChanges');
|
2015-08-09 07:06:52 -04:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', 'PageController@restoreRevision');
|
2015-08-05 15:59:39 -04:00
|
|
|
|
2015-08-09 07:06:52 -04:00
|
|
|
// Chapters
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create');
|
2018-03-25 06:34:42 -04:00
|
|
|
Route::post('/{bookSlug}/chapter/{chapterSlug}/create-guest-page', 'PageController@createAsGuest');
|
|
|
|
Route::get('/{bookSlug}/create-chapter', 'ChapterController@create');
|
|
|
|
Route::post('/{bookSlug}/create-chapter', 'ChapterController@store');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show');
|
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update');
|
2016-06-25 10:31:38 -04:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@showMove');
|
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@move');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit');
|
2016-03-30 15:15:44 -04:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@showRestrict');
|
2017-02-26 09:25:02 -05:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/export/pdf', 'ChapterController@exportPdf');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/export/html', 'ChapterController@exportHtml');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/export/plaintext', 'ChapterController@exportPlainText');
|
2016-03-30 15:15:44 -04:00
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@restrict');
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
|
|
|
|
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2016-02-16 16:25:11 -05:00
|
|
|
// User Profile routes
|
|
|
|
Route::get('/user/{userId}', 'UserController@showProfilePage');
|
2015-08-08 15:05:30 -04:00
|
|
|
|
|
|
|
// Image routes
|
2015-12-07 18:00:34 -05:00
|
|
|
Route::group(['prefix' => 'images'], function() {
|
2015-12-09 17:30:55 -05:00
|
|
|
// Get for user images
|
|
|
|
Route::get('/user/all', 'ImageController@getAllForUserType');
|
|
|
|
Route::get('/user/all/{page}', 'ImageController@getAllForUserType');
|
2015-12-08 17:04:59 -05:00
|
|
|
// Standard get, update and deletion for all types
|
|
|
|
Route::get('/thumb/{id}/{width}/{height}/{crop}', 'ImageController@getThumbnail');
|
2017-12-30 10:24:03 -05:00
|
|
|
Route::get('/base64/{id}', 'ImageController@getBase64Image');
|
2015-12-07 18:00:34 -05:00
|
|
|
Route::put('/update/{imageId}', 'ImageController@update');
|
2017-12-30 10:24:03 -05:00
|
|
|
Route::post('/drawing/upload', 'ImageController@uploadDrawing');
|
2018-01-20 09:01:35 -05:00
|
|
|
Route::put('/drawing/upload/{id}', 'ImageController@replaceDrawing');
|
2015-12-08 17:04:59 -05:00
|
|
|
Route::post('/{type}/upload', 'ImageController@uploadByType');
|
|
|
|
Route::get('/{type}/all', 'ImageController@getAllByType');
|
|
|
|
Route::get('/{type}/all/{page}', 'ImageController@getAllByType');
|
2016-04-03 09:59:54 -04:00
|
|
|
Route::get('/{type}/search/{page}', 'ImageController@searchByType');
|
|
|
|
Route::get('/gallery/{filter}/{page}', 'ImageController@getGalleryFiltered');
|
2017-12-30 10:24:03 -05:00
|
|
|
Route::delete('/{id}', 'ImageController@destroy');
|
2015-12-07 18:00:34 -05:00
|
|
|
});
|
2015-07-12 15:01:42 -04:00
|
|
|
|
2016-11-12 09:12:26 -05:00
|
|
|
// Attachments routes
|
|
|
|
Route::get('/attachments/{id}', 'AttachmentController@get');
|
|
|
|
Route::post('/attachments/upload', 'AttachmentController@upload');
|
|
|
|
Route::post('/attachments/upload/{id}', 'AttachmentController@uploadUpdate');
|
|
|
|
Route::post('/attachments/link', 'AttachmentController@attachLink');
|
|
|
|
Route::put('/attachments/{id}', 'AttachmentController@update');
|
|
|
|
Route::get('/attachments/get/page/{pageId}', 'AttachmentController@listForPage');
|
|
|
|
Route::put('/attachments/sort/page/{pageId}', 'AttachmentController@sortForPage');
|
|
|
|
Route::delete('/attachments/{id}', 'AttachmentController@delete');
|
2016-10-09 13:58:22 -04:00
|
|
|
|
2016-05-06 15:33:08 -04:00
|
|
|
// AJAX routes
|
2016-03-13 08:04:08 -04:00
|
|
|
Route::put('/ajax/page/{id}/save-draft', 'PageController@saveDraft');
|
2016-03-12 10:52:19 -05:00
|
|
|
Route::get('/ajax/page/{id}', 'PageController@getPageAjax');
|
2016-03-13 08:04:08 -04:00
|
|
|
Route::delete('/ajax/page/{id}', 'PageController@ajaxDestroy');
|
2016-03-09 17:32:07 -05:00
|
|
|
|
2016-05-13 16:20:21 -04:00
|
|
|
// Tag routes (AJAX)
|
|
|
|
Route::group(['prefix' => 'ajax/tags'], function() {
|
|
|
|
Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
|
2016-05-15 15:12:53 -04:00
|
|
|
Route::get('/suggest/names', 'TagController@getNameSuggestions');
|
|
|
|
Route::get('/suggest/values', 'TagController@getValueSuggestions');
|
2016-05-06 15:33:08 -04:00
|
|
|
});
|
|
|
|
|
2016-06-12 07:14:14 -04:00
|
|
|
Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
|
|
|
|
|
2017-01-13 11:15:48 -05:00
|
|
|
// Comments
|
2017-09-03 11:37:51 -04:00
|
|
|
Route::post('/ajax/page/{pageId}/comment', 'CommentController@savePageComment');
|
|
|
|
Route::put('/ajax/comment/{id}', 'CommentController@update');
|
2017-01-13 11:15:48 -05:00
|
|
|
Route::delete('/ajax/comment/{id}', 'CommentController@destroy');
|
2017-04-18 15:51:45 -04:00
|
|
|
|
2015-08-08 15:05:30 -04:00
|
|
|
// Links
|
2015-08-05 15:59:39 -04:00
|
|
|
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
2015-08-08 15:05:30 -04:00
|
|
|
|
|
|
|
// Search
|
2017-04-09 15:59:57 -04:00
|
|
|
Route::get('/search', 'SearchController@search');
|
2015-09-01 10:35:11 -04:00
|
|
|
Route::get('/search/book/{bookId}', 'SearchController@searchBook');
|
2017-04-15 14:16:07 -04:00
|
|
|
Route::get('/search/chapter/{bookId}', 'SearchController@searchChapter');
|
2015-07-13 16:52:56 -04:00
|
|
|
|
2015-08-16 15:11:21 -04:00
|
|
|
// Other Pages
|
|
|
|
Route::get('/', 'HomeController@index');
|
|
|
|
Route::get('/home', 'HomeController@index');
|
2017-12-08 06:52:43 -05:00
|
|
|
Route::get('/custom-head-content', 'HomeController@customHeadContent');
|
2015-07-13 16:52:56 -04:00
|
|
|
|
2015-08-30 10:31:16 -04:00
|
|
|
// Settings
|
2016-02-16 16:25:11 -05:00
|
|
|
Route::group(['prefix' => 'settings'], function() {
|
2017-02-25 07:41:32 -05:00
|
|
|
Route::get('/', 'SettingController@index')->name('settings');
|
2016-02-16 16:25:11 -05:00
|
|
|
Route::post('/', 'SettingController@update');
|
2016-02-26 18:44:02 -05:00
|
|
|
|
2016-02-16 16:25:11 -05:00
|
|
|
// Users
|
|
|
|
Route::get('/users', 'UserController@index');
|
|
|
|
Route::get('/users/create', 'UserController@create');
|
|
|
|
Route::get('/users/{id}/delete', 'UserController@delete');
|
2017-12-29 11:49:03 -05:00
|
|
|
Route::patch('/users/{id}/switch-book-view', 'UserController@switchBookView');
|
2016-02-16 16:25:11 -05:00
|
|
|
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-26 18:44:02 -05:00
|
|
|
|
|
|
|
// Roles
|
|
|
|
Route::get('/roles', 'PermissionController@listRoles');
|
2016-02-27 14:24:42 -05: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-26 18:44:02 -05:00
|
|
|
Route::get('/roles/{id}', 'PermissionController@editRole');
|
2016-02-27 14:24:42 -05:00
|
|
|
Route::put('/roles/{id}', 'PermissionController@updateRole');
|
2016-02-16 16:25:11 -05:00
|
|
|
});
|
2015-08-30 10:31:16 -04:00
|
|
|
|
2015-07-12 15:01:42 -04:00
|
|
|
});
|
2015-08-05 16:16:10 -04:00
|
|
|
|
2016-09-17 13:22:04 -04:00
|
|
|
// Social auth routes
|
2016-11-27 14:11:15 -05:00
|
|
|
Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin');
|
2016-09-17 13:22:04 -04:00
|
|
|
Route::get('/login/service/{socialDriver}/callback', 'Auth\RegisterController@socialCallback');
|
|
|
|
Route::get('/login/service/{socialDriver}/detach', 'Auth\RegisterController@detachSocialAccount');
|
|
|
|
Route::get('/register/service/{socialDriver}', 'Auth\RegisterController@socialRegister');
|
2015-09-04 15:40:36 -04:00
|
|
|
|
2015-08-23 10:46:02 -04:00
|
|
|
// Login/Logout routes
|
2016-09-17 13:22:04 -04:00
|
|
|
Route::get('/login', 'Auth\LoginController@getLogin');
|
|
|
|
Route::post('/login', 'Auth\LoginController@login');
|
|
|
|
Route::get('/logout', 'Auth\LoginController@logout');
|
|
|
|
Route::get('/register', 'Auth\RegisterController@getRegister');
|
|
|
|
Route::get('/register/confirm', 'Auth\RegisterController@getRegisterConfirmation');
|
|
|
|
Route::get('/register/confirm/awaiting', 'Auth\RegisterController@showAwaitingConfirmation');
|
|
|
|
Route::post('/register/confirm/resend', 'Auth\RegisterController@resendConfirmation');
|
|
|
|
Route::get('/register/confirm/{token}', 'Auth\RegisterController@confirmEmail');
|
|
|
|
Route::post('/register', 'Auth\RegisterController@postRegister');
|
2015-09-04 12:16:58 -04:00
|
|
|
|
2015-08-23 10:46:02 -04:00
|
|
|
// Password reset link request routes...
|
2016-09-17 13:22:04 -04:00
|
|
|
Route::get('/password/email', 'Auth\ForgotPasswordController@showLinkRequestForm');
|
|
|
|
Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
|
|
|
|
2015-08-23 10:46:02 -04:00
|
|
|
// Password reset routes...
|
2016-09-17 13:22:04 -04:00
|
|
|
Route::get('/password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
|
|
|
|
Route::post('/password/reset', 'Auth\ResetPasswordController@reset');
|