2015-07-12 19:01:42 +00:00
|
|
|
<?php
|
|
|
|
|
2018-03-31 11:41:40 +00:00
|
|
|
Route::get('/robots.txt', 'HomeController@getRobots');
|
2016-12-31 14:27:40 +00:00
|
|
|
|
2015-08-30 10:47:58 +00:00
|
|
|
// Authenticated routes...
|
2015-08-29 14:03:42 +00:00
|
|
|
Route::group(['middleware' => 'auth'], function () {
|
2015-08-05 19:59:39 +00:00
|
|
|
|
2019-05-04 14:48:15 +00:00
|
|
|
// Secure images routing
|
|
|
|
Route::get('/uploads/images/{path}', 'Images\ImageController@showImage')
|
2018-01-13 11:11:23 +00:00
|
|
|
->where('path', '.*$');
|
|
|
|
|
2019-10-05 11:55:01 +00:00
|
|
|
Route::get('/pages/recently-updated', 'PageController@showRecentlyUpdated');
|
2016-02-20 18:51:01 +00:00
|
|
|
|
2018-08-27 13:18:09 +00:00
|
|
|
// Shelves
|
|
|
|
Route::get('/create-shelf', 'BookshelfController@create');
|
|
|
|
Route::group(['prefix' => 'shelves'], function() {
|
|
|
|
Route::get('/', 'BookshelfController@index');
|
|
|
|
Route::post('/', 'BookshelfController@store');
|
2018-09-16 18:34:09 +00:00
|
|
|
Route::get('/{slug}/edit', 'BookshelfController@edit');
|
|
|
|
Route::get('/{slug}/delete', 'BookshelfController@showDelete');
|
|
|
|
Route::get('/{slug}', 'BookshelfController@show');
|
|
|
|
Route::put('/{slug}', 'BookshelfController@update');
|
|
|
|
Route::delete('/{slug}', 'BookshelfController@destroy');
|
2019-02-03 13:45:45 +00:00
|
|
|
Route::get('/{slug}/permissions', 'BookshelfController@showPermissions');
|
|
|
|
Route::put('/{slug}/permissions', 'BookshelfController@permissions');
|
2018-09-20 18:16:11 +00:00
|
|
|
Route::post('/{slug}/copy-permissions', 'BookshelfController@copyPermissions');
|
2019-04-15 19:43:25 +00:00
|
|
|
|
|
|
|
Route::get('/{shelfSlug}/create-book', 'BookController@create');
|
|
|
|
Route::post('/{shelfSlug}/create-book', 'BookController@store');
|
2018-08-27 13:18:09 +00:00
|
|
|
});
|
|
|
|
|
2018-03-25 10:34:42 +00:00
|
|
|
Route::get('/create-book', 'BookController@create');
|
2015-08-29 14:03:42 +00:00
|
|
|
Route::group(['prefix' => 'books'], function () {
|
2015-08-05 19:59:39 +00:00
|
|
|
|
2015-08-09 11:06:52 +00:00
|
|
|
// Books
|
2015-08-05 19:59:39 +00: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');
|
2019-10-05 11:55:01 +00:00
|
|
|
Route::get('/{slug}/sort-item', 'BookSortController@showItem');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{slug}', 'BookController@show');
|
2019-01-31 20:37:12 +00:00
|
|
|
Route::get('/{bookSlug}/permissions', 'BookController@showPermissions');
|
|
|
|
Route::put('/{bookSlug}/permissions', 'BookController@permissions');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{slug}/delete', 'BookController@showDelete');
|
2019-10-05 11:55:01 +00:00
|
|
|
Route::get('/{bookSlug}/sort', 'BookSortController@show');
|
|
|
|
Route::put('/{bookSlug}/sort', 'BookSortController@update');
|
2019-09-15 21:33:27 +00:00
|
|
|
Route::get('/{bookSlug}/export/html', 'BookExportController@html');
|
|
|
|
Route::get('/{bookSlug}/export/pdf', 'BookExportController@pdf');
|
|
|
|
Route::get('/{bookSlug}/export/plaintext', 'BookExportController@plainText');
|
2015-09-06 13:35:53 +00:00
|
|
|
|
2015-08-09 11:06:52 +00:00
|
|
|
// Pages
|
2018-03-25 10:34:42 +00:00
|
|
|
Route::get('/{bookSlug}/create-page', 'PageController@create');
|
|
|
|
Route::post('/{bookSlug}/create-guest-page', 'PageController@createAsGuest');
|
2016-03-13 12:04:08 +00:00
|
|
|
Route::get('/{bookSlug}/draft/{pageId}', 'PageController@editDraft');
|
2016-05-13 20:20:21 +00:00
|
|
|
Route::post('/{bookSlug}/draft/{pageId}', 'PageController@store');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
|
2019-09-15 21:33:27 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/pdf', 'PageExportController@pdf');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageExportController@html');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageExportController@plainText');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
|
2016-06-11 20:04:18 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/move', 'PageController@showMove');
|
2016-06-12 11:14:14 +00:00
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}/move', 'PageController@move');
|
2018-04-14 17:00:16 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/copy', 'PageController@showCopy');
|
|
|
|
Route::post('/{bookSlug}/page/{pageSlug}/copy', 'PageController@copy');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete');
|
2016-03-13 12:04:08 +00:00
|
|
|
Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft');
|
2019-02-02 11:41:41 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@showPermissions');
|
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@permissions');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
|
|
|
|
Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy');
|
2016-03-13 12:04:08 +00:00
|
|
|
Route::delete('/{bookSlug}/draft/{pageId}', 'PageController@destroyDraft');
|
2015-08-30 10:47:58 +00:00
|
|
|
|
2016-01-20 22:13:13 +00:00
|
|
|
// Revisions
|
2019-10-05 11:55:01 +00:00
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions', 'PageRevisionController@index');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', 'PageRevisionController@show');
|
|
|
|
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', 'PageRevisionController@changes');
|
|
|
|
Route::put('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', 'PageRevisionController@restore');
|
|
|
|
Route::delete('/{bookSlug}/page/{pageSlug}/revisions/{revId}/delete', 'PageRevisionController@destroy');
|
2015-08-05 19:59:39 +00:00
|
|
|
|
2015-08-09 11:06:52 +00:00
|
|
|
// Chapters
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create');
|
2018-03-25 10:34:42 +00: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 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show');
|
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update');
|
2016-06-25 14:31:38 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@showMove');
|
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@move');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit');
|
2019-02-02 11:41:41 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@showPermissions');
|
2019-09-15 21:33:27 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/export/pdf', 'ChapterExportController@pdf');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/export/html', 'ChapterExportController@html');
|
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/export/plaintext', 'ChapterExportController@plainText');
|
2019-02-02 11:41:41 +00:00
|
|
|
Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@permissions');
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
|
|
|
|
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
|
|
|
|
});
|
|
|
|
|
2016-02-16 21:25:11 +00:00
|
|
|
// User Profile routes
|
|
|
|
Route::get('/user/{userId}', 'UserController@showProfilePage');
|
2015-08-08 19:05:30 +00:00
|
|
|
|
|
|
|
// Image routes
|
2019-04-27 13:18:00 +00:00
|
|
|
Route::group(['prefix' => 'images'], function () {
|
|
|
|
|
|
|
|
// Gallery
|
|
|
|
Route::get('/gallery', 'Images\GalleryImageController@list');
|
|
|
|
Route::post('/gallery', 'Images\GalleryImageController@create');
|
2019-04-27 13:55:23 +00:00
|
|
|
|
2019-04-27 13:18:00 +00:00
|
|
|
// Drawio
|
|
|
|
Route::get('/drawio', 'Images\DrawioImageController@list');
|
2019-05-04 14:48:15 +00:00
|
|
|
Route::get('/drawio/base64/{id}', 'Images\DrawioImageController@getAsBase64');
|
2019-04-27 13:18:00 +00:00
|
|
|
Route::post('/drawio', 'Images\DrawioImageController@create');
|
2019-04-21 14:52:29 +00:00
|
|
|
|
2019-05-04 14:48:15 +00:00
|
|
|
// Shared gallery & draw.io endpoint
|
|
|
|
Route::get('/usage/{id}', 'Images\ImageController@usage');
|
|
|
|
Route::put('/{id}', 'Images\ImageController@update');
|
|
|
|
Route::delete('/{id}', 'Images\ImageController@destroy');
|
2015-12-07 23:00:34 +00:00
|
|
|
});
|
2015-07-12 19:01:42 +00:00
|
|
|
|
2016-11-12 14:12:26 +00: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 17:58:22 +00:00
|
|
|
|
2016-05-06 19:33:08 +00:00
|
|
|
// AJAX routes
|
2016-03-13 12:04:08 +00:00
|
|
|
Route::put('/ajax/page/{id}/save-draft', 'PageController@saveDraft');
|
2016-03-12 15:52:19 +00:00
|
|
|
Route::get('/ajax/page/{id}', 'PageController@getPageAjax');
|
2016-03-13 12:04:08 +00:00
|
|
|
Route::delete('/ajax/page/{id}', 'PageController@ajaxDestroy');
|
2016-03-09 22:32:07 +00:00
|
|
|
|
2016-05-13 20:20:21 +00:00
|
|
|
// Tag routes (AJAX)
|
|
|
|
Route::group(['prefix' => 'ajax/tags'], function() {
|
|
|
|
Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
|
2016-05-15 19:12:53 +00:00
|
|
|
Route::get('/suggest/names', 'TagController@getNameSuggestions');
|
|
|
|
Route::get('/suggest/values', 'TagController@getValueSuggestions');
|
2016-05-06 19:33:08 +00:00
|
|
|
});
|
|
|
|
|
2016-06-12 11:14:14 +00:00
|
|
|
Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
|
|
|
|
|
2017-01-13 16:15:48 +00:00
|
|
|
// Comments
|
2017-09-03 15:37:51 +00:00
|
|
|
Route::post('/ajax/page/{pageId}/comment', 'CommentController@savePageComment');
|
|
|
|
Route::put('/ajax/comment/{id}', 'CommentController@update');
|
2017-01-13 16:15:48 +00:00
|
|
|
Route::delete('/ajax/comment/{id}', 'CommentController@destroy');
|
2017-04-18 19:51:45 +00:00
|
|
|
|
2015-08-08 19:05:30 +00:00
|
|
|
// Links
|
2015-08-05 19:59:39 +00:00
|
|
|
Route::get('/link/{id}', 'PageController@redirectFromLink');
|
2015-08-08 19:05:30 +00:00
|
|
|
|
|
|
|
// Search
|
2017-04-09 19:59:57 +00:00
|
|
|
Route::get('/search', 'SearchController@search');
|
2015-09-01 14:35:11 +00:00
|
|
|
Route::get('/search/book/{bookId}', 'SearchController@searchBook');
|
2017-04-15 18:16:07 +00:00
|
|
|
Route::get('/search/chapter/{bookId}', 'SearchController@searchChapter');
|
2019-02-24 15:57:35 +00:00
|
|
|
Route::get('/search/entity/siblings', 'SearchController@searchSiblings');
|
2015-07-13 20:52:56 +00:00
|
|
|
|
2019-08-11 19:04:43 +00:00
|
|
|
Route::get('/templates', 'PageTemplateController@list');
|
|
|
|
Route::get('/templates/{templateId}', 'PageTemplateController@get');
|
|
|
|
|
2015-08-16 19:11:21 +00:00
|
|
|
// Other Pages
|
|
|
|
Route::get('/', 'HomeController@index');
|
|
|
|
Route::get('/home', 'HomeController@index');
|
2017-12-08 11:52:43 +00:00
|
|
|
Route::get('/custom-head-content', 'HomeController@customHeadContent');
|
2015-07-13 20:52:56 +00:00
|
|
|
|
2015-08-30 14:31:16 +00:00
|
|
|
// Settings
|
2016-02-16 21:25:11 +00:00
|
|
|
Route::group(['prefix' => 'settings'], function() {
|
2017-02-25 12:41:32 +00:00
|
|
|
Route::get('/', 'SettingController@index')->name('settings');
|
2016-02-16 21:25:11 +00:00
|
|
|
Route::post('/', 'SettingController@update');
|
2016-02-26 23:44:02 +00:00
|
|
|
|
2018-05-27 18:40:07 +00:00
|
|
|
// Maintenance
|
|
|
|
Route::get('/maintenance', 'SettingController@showMaintenance');
|
|
|
|
Route::delete('/maintenance/cleanup-images', 'SettingController@cleanupImages');
|
2019-10-15 16:41:08 +00:00
|
|
|
Route::post('/maintenance/send-test-email', 'SettingController@sendTestEmail');
|
2018-05-27 18:40:07 +00:00
|
|
|
|
2016-02-16 21:25:11 +00:00
|
|
|
// Users
|
|
|
|
Route::get('/users', 'UserController@index');
|
|
|
|
Route::get('/users/create', 'UserController@create');
|
|
|
|
Route::get('/users/{id}/delete', 'UserController@delete');
|
2017-12-29 16:49:03 +00:00
|
|
|
Route::patch('/users/{id}/switch-book-view', 'UserController@switchBookView');
|
2018-08-27 13:18:09 +00:00
|
|
|
Route::patch('/users/{id}/switch-shelf-view', 'UserController@switchShelfView');
|
2019-02-03 13:45:45 +00:00
|
|
|
Route::patch('/users/{id}/change-sort/{type}', 'UserController@changeSort');
|
2019-04-14 12:01:51 +00:00
|
|
|
Route::patch('/users/{id}/update-expansion-preference/{key}', 'UserController@updateExpansionPreference');
|
2016-02-16 21:25:11 +00: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 23:44:02 +00:00
|
|
|
|
|
|
|
// Roles
|
|
|
|
Route::get('/roles', 'PermissionController@listRoles');
|
2016-02-27 19:24:42 +00: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 23:44:02 +00:00
|
|
|
Route::get('/roles/{id}', 'PermissionController@editRole');
|
2016-02-27 19:24:42 +00:00
|
|
|
Route::put('/roles/{id}', 'PermissionController@updateRole');
|
2016-02-16 21:25:11 +00:00
|
|
|
});
|
2015-08-30 14:31:16 +00:00
|
|
|
|
2015-07-12 19:01:42 +00:00
|
|
|
});
|
2015-08-05 20:16:10 +00:00
|
|
|
|
2016-09-17 17:22:04 +00:00
|
|
|
// Social auth routes
|
2016-11-27 19:11:15 +00:00
|
|
|
Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin');
|
2016-09-17 17:22:04 +00: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 19:40:36 +00:00
|
|
|
|
2015-08-23 14:46:02 +00:00
|
|
|
// Login/Logout routes
|
2016-09-17 17:22:04 +00: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');
|
2019-08-18 09:47:59 +00:00
|
|
|
Route::get('/register/confirm', 'Auth\ConfirmEmailController@show');
|
|
|
|
Route::get('/register/confirm/awaiting', 'Auth\ConfirmEmailController@showAwaiting');
|
|
|
|
Route::post('/register/confirm/resend', 'Auth\ConfirmEmailController@resend');
|
|
|
|
Route::get('/register/confirm/{token}', 'Auth\ConfirmEmailController@confirm');
|
2016-09-17 17:22:04 +00:00
|
|
|
Route::post('/register', 'Auth\RegisterController@postRegister');
|
2015-09-04 16:16:58 +00:00
|
|
|
|
2019-11-17 13:26:43 +00:00
|
|
|
// SAML routes
|
|
|
|
// TODO - Prevent access without SAML2 enabled via middleware
|
|
|
|
Route::get('/saml2/login', 'Auth\Saml2Controller@login');
|
2019-11-17 15:40:36 +00:00
|
|
|
Route::get('/saml2/logout', 'Auth\Saml2Controller@logout');
|
2019-11-17 13:26:43 +00:00
|
|
|
Route::get('/saml2/metadata', 'Auth\Saml2Controller@metadata');
|
|
|
|
Route::get('/saml2/sls', 'Auth\Saml2Controller@sls');
|
|
|
|
Route::post('/saml2/acs', 'Auth\Saml2Controller@acs');
|
|
|
|
|
2019-08-18 12:11:30 +00:00
|
|
|
// User invitation routes
|
|
|
|
Route::get('/register/invite/{token}', 'Auth\UserInviteController@showSetPassword');
|
|
|
|
Route::post('/register/invite/{token}', 'Auth\UserInviteController@setPassword');
|
|
|
|
|
2015-08-23 14:46:02 +00:00
|
|
|
// Password reset link request routes...
|
2016-09-17 17:22:04 +00:00
|
|
|
Route::get('/password/email', 'Auth\ForgotPasswordController@showLinkRequestForm');
|
|
|
|
Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
|
|
|
|
2015-08-23 14:46:02 +00:00
|
|
|
// Password reset routes...
|
2016-09-17 17:22:04 +00:00
|
|
|
Route::get('/password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
|
2018-05-19 16:01:33 +00:00
|
|
|
Route::post('/password/reset', 'Auth\ResetPasswordController@reset');
|
|
|
|
|
|
|
|
Route::fallback('HomeController@getNotFound');
|