2015-07-13 03:01:42 +08:00
|
|
|
<?php
|
|
|
|
|
2023-05-19 03:53:39 +08:00
|
|
|
use BookStack\Access\Controllers as AccessControllers;
|
|
|
|
use BookStack\Activity\Controllers as ActivityControllers;
|
|
|
|
use BookStack\Api\ApiDocsController;
|
2023-05-18 00:56:55 +08:00
|
|
|
use BookStack\Api\UserApiTokenController;
|
2023-05-19 03:53:39 +08:00
|
|
|
use BookStack\App\HomeController;
|
2024-03-24 00:31:13 +08:00
|
|
|
use BookStack\App\MetaController;
|
2023-05-19 03:53:39 +08:00
|
|
|
use BookStack\Entities\Controllers as EntityControllers;
|
2024-10-15 23:14:11 +08:00
|
|
|
use BookStack\Exports\Controllers as ExportControllers;
|
2021-12-07 22:55:11 +08:00
|
|
|
use BookStack\Http\Middleware\VerifyCsrfToken;
|
2023-05-18 00:56:55 +08:00
|
|
|
use BookStack\Permissions\PermissionsController;
|
|
|
|
use BookStack\References\ReferenceController;
|
|
|
|
use BookStack\Search\SearchController;
|
2023-05-19 03:53:39 +08:00
|
|
|
use BookStack\Settings as SettingControllers;
|
|
|
|
use BookStack\Uploads\Controllers as UploadControllers;
|
|
|
|
use BookStack\Users\Controllers as UserControllers;
|
2021-12-07 22:55:11 +08:00
|
|
|
use Illuminate\Session\Middleware\StartSession;
|
2021-10-31 04:29:59 +08:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2021-12-07 22:55:11 +08:00
|
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
2021-10-31 04:29:59 +08:00
|
|
|
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/status', [SettingControllers\StatusController::class, 'show']);
|
2024-03-24 00:31:13 +08:00
|
|
|
Route::get('/robots.txt', [MetaController::class, 'robots']);
|
|
|
|
Route::get('/favicon.ico', [MetaController::class, 'favicon']);
|
|
|
|
Route::get('/manifest.json', [MetaController::class, 'pwaManifest']);
|
|
|
|
Route::get('/licenses', [MetaController::class, 'licenses']);
|
2024-09-10 04:54:33 +08:00
|
|
|
Route::get('/opensearch.xml', [MetaController::class, 'opensearch']);
|
2016-12-31 22:27:40 +08:00
|
|
|
|
2015-08-30 18:47:58 +08:00
|
|
|
// Authenticated routes...
|
2021-10-31 04:29:59 +08:00
|
|
|
Route::middleware('auth')->group(function () {
|
2015-08-06 03:59:39 +08:00
|
|
|
|
2019-05-04 22:48:15 +08:00
|
|
|
// Secure images routing
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/uploads/images/{path}', [UploadControllers\ImageController::class, 'showImage'])
|
2018-01-13 19:11:23 +08:00
|
|
|
->where('path', '.*$');
|
|
|
|
|
2021-09-04 20:57:04 +08:00
|
|
|
// API docs routes
|
2023-05-29 21:41:59 +08:00
|
|
|
Route::get('/api', [ApiDocsController::class, 'redirect']);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/api/docs', [ApiDocsController::class, 'display']);
|
2021-09-04 20:57:04 +08:00
|
|
|
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/pages/recently-updated', [EntityControllers\PageController::class, 'showRecentlyUpdated']);
|
2016-02-21 02:51:01 +08:00
|
|
|
|
2018-08-27 21:18:09 +08:00
|
|
|
// Shelves
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/create-shelf', [EntityControllers\BookshelfController::class, 'create']);
|
|
|
|
Route::get('/shelves/', [EntityControllers\BookshelfController::class, 'index']);
|
|
|
|
Route::post('/shelves/', [EntityControllers\BookshelfController::class, 'store']);
|
|
|
|
Route::get('/shelves/{slug}/edit', [EntityControllers\BookshelfController::class, 'edit']);
|
|
|
|
Route::get('/shelves/{slug}/delete', [EntityControllers\BookshelfController::class, 'showDelete']);
|
|
|
|
Route::get('/shelves/{slug}', [EntityControllers\BookshelfController::class, 'show']);
|
|
|
|
Route::put('/shelves/{slug}', [EntityControllers\BookshelfController::class, 'update']);
|
|
|
|
Route::delete('/shelves/{slug}', [EntityControllers\BookshelfController::class, 'destroy']);
|
2022-10-09 23:36:03 +08:00
|
|
|
Route::get('/shelves/{slug}/permissions', [PermissionsController::class, 'showForShelf']);
|
|
|
|
Route::put('/shelves/{slug}/permissions', [PermissionsController::class, 'updateForShelf']);
|
|
|
|
Route::post('/shelves/{slug}/copy-permissions', [PermissionsController::class, 'copyShelfPermissionsToBooks']);
|
2022-08-20 05:40:44 +08:00
|
|
|
Route::get('/shelves/{slug}/references', [ReferenceController::class, 'shelf']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Book Creation
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/shelves/{shelfSlug}/create-book', [EntityControllers\BookController::class, 'create']);
|
|
|
|
Route::post('/shelves/{shelfSlug}/create-book', [EntityControllers\BookController::class, 'store']);
|
|
|
|
Route::get('/create-book', [EntityControllers\BookController::class, 'create']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Books
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/', [EntityControllers\BookController::class, 'index']);
|
|
|
|
Route::post('/books/', [EntityControllers\BookController::class, 'store']);
|
|
|
|
Route::get('/books/{slug}/edit', [EntityControllers\BookController::class, 'edit']);
|
|
|
|
Route::put('/books/{slug}', [EntityControllers\BookController::class, 'update']);
|
|
|
|
Route::delete('/books/{id}', [EntityControllers\BookController::class, 'destroy']);
|
|
|
|
Route::get('/books/{slug}/sort-item', [EntityControllers\BookSortController::class, 'showItem']);
|
|
|
|
Route::get('/books/{slug}', [EntityControllers\BookController::class, 'show']);
|
2022-10-09 23:36:03 +08:00
|
|
|
Route::get('/books/{bookSlug}/permissions', [PermissionsController::class, 'showForBook']);
|
|
|
|
Route::put('/books/{bookSlug}/permissions', [PermissionsController::class, 'updateForBook']);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/{slug}/delete', [EntityControllers\BookController::class, 'showDelete']);
|
|
|
|
Route::get('/books/{bookSlug}/copy', [EntityControllers\BookController::class, 'showCopy']);
|
|
|
|
Route::post('/books/{bookSlug}/copy', [EntityControllers\BookController::class, 'copy']);
|
|
|
|
Route::post('/books/{bookSlug}/convert-to-shelf', [EntityControllers\BookController::class, 'convertToShelf']);
|
|
|
|
Route::get('/books/{bookSlug}/sort', [EntityControllers\BookSortController::class, 'show']);
|
|
|
|
Route::put('/books/{bookSlug}/sort', [EntityControllers\BookSortController::class, 'update']);
|
2022-08-20 05:40:44 +08:00
|
|
|
Route::get('/books/{slug}/references', [ReferenceController::class, 'book']);
|
2024-10-15 23:14:11 +08:00
|
|
|
Route::get('/books/{bookSlug}/export/html', [ExportControllers\BookExportController::class, 'html']);
|
|
|
|
Route::get('/books/{bookSlug}/export/pdf', [ExportControllers\BookExportController::class, 'pdf']);
|
|
|
|
Route::get('/books/{bookSlug}/export/markdown', [ExportControllers\BookExportController::class, 'markdown']);
|
|
|
|
Route::get('/books/{bookSlug}/export/zip', [ExportControllers\BookExportController::class, 'zip']);
|
|
|
|
Route::get('/books/{bookSlug}/export/plaintext', [ExportControllers\BookExportController::class, 'plainText']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Pages
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/{bookSlug}/create-page', [EntityControllers\PageController::class, 'create']);
|
|
|
|
Route::post('/books/{bookSlug}/create-guest-page', [EntityControllers\PageController::class, 'createAsGuest']);
|
|
|
|
Route::get('/books/{bookSlug}/draft/{pageId}', [EntityControllers\PageController::class, 'editDraft']);
|
|
|
|
Route::post('/books/{bookSlug}/draft/{pageId}', [EntityControllers\PageController::class, 'store']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}', [EntityControllers\PageController::class, 'show']);
|
2024-10-15 23:14:11 +08:00
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/export/pdf', [ExportControllers\PageExportController::class, 'pdf']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/export/html', [ExportControllers\PageExportController::class, 'html']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/export/markdown', [ExportControllers\PageExportController::class, 'markdown']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/export/plaintext', [ExportControllers\PageExportController::class, 'plainText']);
|
2024-10-19 22:41:07 +08:00
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/export/zip', [ExportControllers\PageExportController::class, 'zip']);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/edit', [EntityControllers\PageController::class, 'edit']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/move', [EntityControllers\PageController::class, 'showMove']);
|
|
|
|
Route::put('/books/{bookSlug}/page/{pageSlug}/move', [EntityControllers\PageController::class, 'move']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/copy', [EntityControllers\PageController::class, 'showCopy']);
|
|
|
|
Route::post('/books/{bookSlug}/page/{pageSlug}/copy', [EntityControllers\PageController::class, 'copy']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/delete', [EntityControllers\PageController::class, 'showDelete']);
|
|
|
|
Route::get('/books/{bookSlug}/draft/{pageId}/delete', [EntityControllers\PageController::class, 'showDeleteDraft']);
|
2022-10-09 23:36:03 +08:00
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/permissions', [PermissionsController::class, 'showForPage']);
|
|
|
|
Route::put('/books/{bookSlug}/page/{pageSlug}/permissions', [PermissionsController::class, 'updateForPage']);
|
2022-08-19 20:14:43 +08:00
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/references', [ReferenceController::class, 'page']);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::put('/books/{bookSlug}/page/{pageSlug}', [EntityControllers\PageController::class, 'update']);
|
|
|
|
Route::delete('/books/{bookSlug}/page/{pageSlug}', [EntityControllers\PageController::class, 'destroy']);
|
|
|
|
Route::delete('/books/{bookSlug}/draft/{pageId}', [EntityControllers\PageController::class, 'destroyDraft']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Revisions
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/revisions', [EntityControllers\PageRevisionController::class, 'index']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/revisions/{revId}', [EntityControllers\PageRevisionController::class, 'show']);
|
|
|
|
Route::get('/books/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', [EntityControllers\PageRevisionController::class, 'changes']);
|
|
|
|
Route::put('/books/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', [EntityControllers\PageRevisionController::class, 'restore']);
|
|
|
|
Route::delete('/books/{bookSlug}/page/{pageSlug}/revisions/{revId}/delete', [EntityControllers\PageRevisionController::class, 'destroy']);
|
2023-06-13 22:13:07 +08:00
|
|
|
Route::delete('/page-revisions/user-drafts/{pageId}', [EntityControllers\PageRevisionController::class, 'destroyUserDraft']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Chapters
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/create-page', [EntityControllers\PageController::class, 'create']);
|
|
|
|
Route::post('/books/{bookSlug}/chapter/{chapterSlug}/create-guest-page', [EntityControllers\PageController::class, 'createAsGuest']);
|
|
|
|
Route::get('/books/{bookSlug}/create-chapter', [EntityControllers\ChapterController::class, 'create']);
|
|
|
|
Route::post('/books/{bookSlug}/create-chapter', [EntityControllers\ChapterController::class, 'store']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}', [EntityControllers\ChapterController::class, 'show']);
|
|
|
|
Route::put('/books/{bookSlug}/chapter/{chapterSlug}', [EntityControllers\ChapterController::class, 'update']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/move', [EntityControllers\ChapterController::class, 'showMove']);
|
|
|
|
Route::put('/books/{bookSlug}/chapter/{chapterSlug}/move', [EntityControllers\ChapterController::class, 'move']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/copy', [EntityControllers\ChapterController::class, 'showCopy']);
|
|
|
|
Route::post('/books/{bookSlug}/chapter/{chapterSlug}/copy', [EntityControllers\ChapterController::class, 'copy']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/edit', [EntityControllers\ChapterController::class, 'edit']);
|
|
|
|
Route::post('/books/{bookSlug}/chapter/{chapterSlug}/convert-to-book', [EntityControllers\ChapterController::class, 'convertToBook']);
|
2022-10-11 22:41:21 +08:00
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/permissions', [PermissionsController::class, 'showForChapter']);
|
2024-10-15 23:14:11 +08:00
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/pdf', [ExportControllers\ChapterExportController::class, 'pdf']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/html', [ExportControllers\ChapterExportController::class, 'html']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/markdown', [ExportControllers\ChapterExportController::class, 'markdown']);
|
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/plaintext', [ExportControllers\ChapterExportController::class, 'plainText']);
|
2024-10-23 22:59:58 +08:00
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/export/zip', [ExportControllers\ChapterExportController::class, 'zip']);
|
2022-10-11 22:41:21 +08:00
|
|
|
Route::put('/books/{bookSlug}/chapter/{chapterSlug}/permissions', [PermissionsController::class, 'updateForChapter']);
|
2022-08-20 05:40:44 +08:00
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/references', [ReferenceController::class, 'chapter']);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/books/{bookSlug}/chapter/{chapterSlug}/delete', [EntityControllers\ChapterController::class, 'showDelete']);
|
|
|
|
Route::delete('/books/{bookSlug}/chapter/{chapterSlug}', [EntityControllers\ChapterController::class, 'destroy']);
|
2015-08-06 03:59:39 +08:00
|
|
|
|
2016-02-17 05:25:11 +08:00
|
|
|
// User Profile routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/user/{slug}', [UserControllers\UserProfileController::class, 'show']);
|
2015-08-09 03:05:30 +08:00
|
|
|
|
|
|
|
// Image routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/images/gallery', [UploadControllers\GalleryImageController::class, 'list']);
|
|
|
|
Route::post('/images/gallery', [UploadControllers\GalleryImageController::class, 'create']);
|
|
|
|
Route::get('/images/drawio', [UploadControllers\DrawioImageController::class, 'list']);
|
|
|
|
Route::get('/images/drawio/base64/{id}', [UploadControllers\DrawioImageController::class, 'getAsBase64']);
|
|
|
|
Route::post('/images/drawio', [UploadControllers\DrawioImageController::class, 'create']);
|
|
|
|
Route::get('/images/edit/{id}', [UploadControllers\ImageController::class, 'edit']);
|
2023-05-29 00:32:22 +08:00
|
|
|
Route::put('/images/{id}/file', [UploadControllers\ImageController::class, 'updateFile']);
|
2023-09-29 20:54:08 +08:00
|
|
|
Route::put('/images/{id}/rebuild-thumbnails', [UploadControllers\ImageController::class, 'rebuildThumbnails']);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::put('/images/{id}', [UploadControllers\ImageController::class, 'update']);
|
|
|
|
Route::delete('/images/{id}', [UploadControllers\ImageController::class, 'destroy']);
|
2015-07-13 03:01:42 +08:00
|
|
|
|
2016-11-12 22:12:26 +08:00
|
|
|
// Attachments routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/attachments/{id}', [UploadControllers\AttachmentController::class, 'get']);
|
|
|
|
Route::post('/attachments/upload', [UploadControllers\AttachmentController::class, 'upload']);
|
|
|
|
Route::post('/attachments/upload/{id}', [UploadControllers\AttachmentController::class, 'uploadUpdate']);
|
|
|
|
Route::post('/attachments/link', [UploadControllers\AttachmentController::class, 'attachLink']);
|
|
|
|
Route::put('/attachments/{id}', [UploadControllers\AttachmentController::class, 'update']);
|
|
|
|
Route::get('/attachments/edit/{id}', [UploadControllers\AttachmentController::class, 'getUpdateForm']);
|
|
|
|
Route::get('/attachments/get/page/{pageId}', [UploadControllers\AttachmentController::class, 'listForPage']);
|
|
|
|
Route::put('/attachments/sort/page/{pageId}', [UploadControllers\AttachmentController::class, 'sortForPage']);
|
|
|
|
Route::delete('/attachments/{id}', [UploadControllers\AttachmentController::class, 'delete']);
|
2016-10-10 01:58:22 +08:00
|
|
|
|
2016-05-07 03:33:08 +08:00
|
|
|
// AJAX routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::put('/ajax/page/{id}/save-draft', [EntityControllers\PageController::class, 'saveDraft']);
|
|
|
|
Route::get('/ajax/page/{id}', [EntityControllers\PageController::class, 'getPageAjax']);
|
|
|
|
Route::delete('/ajax/page/{id}', [EntityControllers\PageController::class, 'ajaxDestroy']);
|
2016-03-10 06:32:07 +08:00
|
|
|
|
2021-11-07 00:30:20 +08:00
|
|
|
// Tag routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/tags', [ActivityControllers\TagController::class, 'index']);
|
|
|
|
Route::get('/ajax/tags/suggest/names', [ActivityControllers\TagController::class, 'getNameSuggestions']);
|
|
|
|
Route::get('/ajax/tags/suggest/values', [ActivityControllers\TagController::class, 'getValueSuggestions']);
|
2016-05-07 03:33:08 +08:00
|
|
|
|
2017-01-14 00:15:48 +08:00
|
|
|
// Comments
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::post('/comment/{pageId}', [ActivityControllers\CommentController::class, 'savePageComment']);
|
|
|
|
Route::put('/comment/{id}', [ActivityControllers\CommentController::class, 'update']);
|
|
|
|
Route::delete('/comment/{id}', [ActivityControllers\CommentController::class, 'destroy']);
|
2017-04-19 03:51:45 +08:00
|
|
|
|
2015-08-09 03:05:30 +08:00
|
|
|
// Links
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/link/{id}', [EntityControllers\PageController::class, 'redirectFromLink']);
|
2015-08-09 03:05:30 +08:00
|
|
|
|
|
|
|
// Search
|
2021-10-31 04:29:59 +08:00
|
|
|
Route::get('/search', [SearchController::class, 'search']);
|
|
|
|
Route::get('/search/book/{bookId}', [SearchController::class, 'searchBook']);
|
|
|
|
Route::get('/search/chapter/{bookId}', [SearchController::class, 'searchChapter']);
|
|
|
|
Route::get('/search/entity/siblings', [SearchController::class, 'searchSiblings']);
|
2022-11-21 18:29:12 +08:00
|
|
|
Route::get('/search/entity-selector', [SearchController::class, 'searchForSelector']);
|
2023-12-11 23:55:43 +08:00
|
|
|
Route::get('/search/entity-selector-templates', [SearchController::class, 'templatesForSelector']);
|
2022-11-21 18:29:12 +08:00
|
|
|
Route::get('/search/suggest', [SearchController::class, 'searchSuggestions']);
|
2015-07-14 04:52:56 +08:00
|
|
|
|
2021-01-01 01:25:20 +08:00
|
|
|
// User Search
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/search/users/select', [UserControllers\UserSearchController::class, 'forSelect']);
|
2021-01-01 01:25:20 +08:00
|
|
|
|
2021-05-16 07:29:56 +08:00
|
|
|
// Template System
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/templates', [EntityControllers\PageTemplateController::class, 'list']);
|
|
|
|
Route::get('/templates/{templateId}', [EntityControllers\PageTemplateController::class, 'get']);
|
2019-08-12 03:04:43 +08:00
|
|
|
|
2021-05-16 07:29:56 +08:00
|
|
|
// Favourites
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/favourites', [ActivityControllers\FavouriteController::class, 'index']);
|
|
|
|
Route::post('/favourites/add', [ActivityControllers\FavouriteController::class, 'add']);
|
|
|
|
Route::post('/favourites/remove', [ActivityControllers\FavouriteController::class, 'remove']);
|
2021-05-16 07:29:56 +08:00
|
|
|
|
2023-08-02 20:14:00 +08:00
|
|
|
// Watching
|
|
|
|
Route::put('/watching/update', [ActivityControllers\WatchController::class, 'update']);
|
|
|
|
|
2024-10-29 20:11:51 +08:00
|
|
|
// Importing
|
|
|
|
Route::get('/import', [ExportControllers\ImportController::class, 'start']);
|
|
|
|
Route::post('/import', [ExportControllers\ImportController::class, 'upload']);
|
|
|
|
|
2015-08-17 03:11:21 +08:00
|
|
|
// Other Pages
|
2021-10-31 04:29:59 +08:00
|
|
|
Route::get('/', [HomeController::class, 'index']);
|
|
|
|
Route::get('/home', [HomeController::class, 'index']);
|
2015-07-14 04:52:56 +08:00
|
|
|
|
2022-10-10 19:24:23 +08:00
|
|
|
// Permissions
|
|
|
|
Route::get('/permissions/form-row/{entityType}/{roleId}', [PermissionsController::class, 'formRowForRole']);
|
|
|
|
|
2021-11-14 23:16:18 +08:00
|
|
|
// Maintenance
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings/maintenance', [SettingControllers\MaintenanceController::class, 'index']);
|
|
|
|
Route::delete('/settings/maintenance/cleanup-images', [SettingControllers\MaintenanceController::class, 'cleanupImages']);
|
|
|
|
Route::post('/settings/maintenance/send-test-email', [SettingControllers\MaintenanceController::class, 'sendTestEmail']);
|
|
|
|
Route::post('/settings/maintenance/regenerate-references', [SettingControllers\MaintenanceController::class, 'regenerateReferences']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Recycle Bin
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings/recycle-bin', [EntityControllers\RecycleBinController::class, 'index']);
|
|
|
|
Route::post('/settings/recycle-bin/empty', [EntityControllers\RecycleBinController::class, 'empty']);
|
|
|
|
Route::get('/settings/recycle-bin/{id}/destroy', [EntityControllers\RecycleBinController::class, 'showDestroy']);
|
|
|
|
Route::delete('/settings/recycle-bin/{id}', [EntityControllers\RecycleBinController::class, 'destroy']);
|
|
|
|
Route::get('/settings/recycle-bin/{id}/restore', [EntityControllers\RecycleBinController::class, 'showRestore']);
|
|
|
|
Route::post('/settings/recycle-bin/{id}/restore', [EntityControllers\RecycleBinController::class, 'restore']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Audit Log
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings/audit', [ActivityControllers\AuditLogController::class, 'index']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Users
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings/users', [UserControllers\UserController::class, 'index']);
|
|
|
|
Route::get('/settings/users/create', [UserControllers\UserController::class, 'create']);
|
|
|
|
Route::get('/settings/users/{id}/delete', [UserControllers\UserController::class, 'delete']);
|
|
|
|
Route::post('/settings/users/create', [UserControllers\UserController::class, 'store']);
|
|
|
|
Route::get('/settings/users/{id}', [UserControllers\UserController::class, 'edit']);
|
|
|
|
Route::put('/settings/users/{id}', [UserControllers\UserController::class, 'update']);
|
|
|
|
Route::delete('/settings/users/{id}', [UserControllers\UserController::class, 'destroy']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
2023-10-17 20:11:10 +08:00
|
|
|
// User Account
|
2023-10-19 00:53:58 +08:00
|
|
|
Route::get('/my-account', [UserControllers\UserAccountController::class, 'redirect']);
|
2023-10-18 19:39:57 +08:00
|
|
|
Route::get('/my-account/profile', [UserControllers\UserAccountController::class, 'showProfile']);
|
|
|
|
Route::put('/my-account/profile', [UserControllers\UserAccountController::class, 'updateProfile']);
|
2023-10-17 20:11:10 +08:00
|
|
|
Route::get('/my-account/shortcuts', [UserControllers\UserAccountController::class, 'showShortcuts']);
|
|
|
|
Route::put('/my-account/shortcuts', [UserControllers\UserAccountController::class, 'updateShortcuts']);
|
|
|
|
Route::get('/my-account/notifications', [UserControllers\UserAccountController::class, 'showNotifications']);
|
|
|
|
Route::put('/my-account/notifications', [UserControllers\UserAccountController::class, 'updateNotifications']);
|
2023-10-18 00:38:07 +08:00
|
|
|
Route::get('/my-account/auth', [UserControllers\UserAccountController::class, 'showAuth']);
|
|
|
|
Route::put('/my-account/auth/password', [UserControllers\UserAccountController::class, 'updatePassword']);
|
2023-10-19 17:48:27 +08:00
|
|
|
Route::get('/my-account/delete', [UserControllers\UserAccountController::class, 'delete']);
|
|
|
|
Route::delete('/my-account', [UserControllers\UserAccountController::class, 'destroy']);
|
2023-10-19 21:18:42 +08:00
|
|
|
|
|
|
|
// User Preference Endpoints
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::patch('/preferences/change-view/{type}', [UserControllers\UserPreferencesController::class, 'changeView']);
|
|
|
|
Route::patch('/preferences/change-sort/{type}', [UserControllers\UserPreferencesController::class, 'changeSort']);
|
|
|
|
Route::patch('/preferences/change-expansion/{type}', [UserControllers\UserPreferencesController::class, 'changeExpansion']);
|
|
|
|
Route::patch('/preferences/toggle-dark-mode', [UserControllers\UserPreferencesController::class, 'toggleDarkMode']);
|
|
|
|
Route::patch('/preferences/update-code-language-favourite', [UserControllers\UserPreferencesController::class, 'updateCodeLanguageFavourite']);
|
2022-10-30 23:25:02 +08:00
|
|
|
|
2021-11-14 23:16:18 +08:00
|
|
|
// User API Tokens
|
2023-10-19 18:31:45 +08:00
|
|
|
Route::get('/api-tokens/{userId}/create', [UserApiTokenController::class, 'create']);
|
|
|
|
Route::post('/api-tokens/{userId}/create', [UserApiTokenController::class, 'store']);
|
|
|
|
Route::get('/api-tokens/{userId}/{tokenId}', [UserApiTokenController::class, 'edit']);
|
|
|
|
Route::put('/api-tokens/{userId}/{tokenId}', [UserApiTokenController::class, 'update']);
|
|
|
|
Route::get('/api-tokens/{userId}/{tokenId}/delete', [UserApiTokenController::class, 'delete']);
|
|
|
|
Route::delete('/api-tokens/{userId}/{tokenId}', [UserApiTokenController::class, 'destroy']);
|
2021-11-14 23:16:18 +08:00
|
|
|
|
|
|
|
// Roles
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings/roles', [UserControllers\RoleController::class, 'index']);
|
|
|
|
Route::get('/settings/roles/new', [UserControllers\RoleController::class, 'create']);
|
|
|
|
Route::post('/settings/roles/new', [UserControllers\RoleController::class, 'store']);
|
|
|
|
Route::get('/settings/roles/delete/{id}', [UserControllers\RoleController::class, 'showDelete']);
|
|
|
|
Route::delete('/settings/roles/delete/{id}', [UserControllers\RoleController::class, 'delete']);
|
|
|
|
Route::get('/settings/roles/{id}', [UserControllers\RoleController::class, 'edit']);
|
|
|
|
Route::put('/settings/roles/{id}', [UserControllers\RoleController::class, 'update']);
|
2021-12-07 22:55:11 +08:00
|
|
|
|
|
|
|
// Webhooks
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings/webhooks', [ActivityControllers\WebhookController::class, 'index']);
|
|
|
|
Route::get('/settings/webhooks/create', [ActivityControllers\WebhookController::class, 'create']);
|
|
|
|
Route::post('/settings/webhooks/create', [ActivityControllers\WebhookController::class, 'store']);
|
|
|
|
Route::get('/settings/webhooks/{id}', [ActivityControllers\WebhookController::class, 'edit']);
|
|
|
|
Route::put('/settings/webhooks/{id}', [ActivityControllers\WebhookController::class, 'update']);
|
|
|
|
Route::get('/settings/webhooks/{id}/delete', [ActivityControllers\WebhookController::class, 'delete']);
|
|
|
|
Route::delete('/settings/webhooks/{id}', [ActivityControllers\WebhookController::class, 'destroy']);
|
2022-03-28 18:09:55 +08:00
|
|
|
|
|
|
|
// Settings
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/settings', [SettingControllers\SettingController::class, 'index'])->name('settings');
|
|
|
|
Route::get('/settings/{category}', [SettingControllers\SettingController::class, 'category'])->name('settings.category');
|
|
|
|
Route::post('/settings/{category}', [SettingControllers\SettingController::class, 'update']);
|
2015-07-13 03:01:42 +08:00
|
|
|
});
|
2015-08-06 04:16:10 +08:00
|
|
|
|
2021-08-03 05:02:25 +08:00
|
|
|
// MFA routes
|
2021-10-31 04:29:59 +08:00
|
|
|
Route::middleware('mfa-setup')->group(function () {
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/mfa/setup', [AccessControllers\MfaController::class, 'setup']);
|
|
|
|
Route::get('/mfa/totp/generate', [AccessControllers\MfaTotpController::class, 'generate']);
|
|
|
|
Route::post('/mfa/totp/confirm', [AccessControllers\MfaTotpController::class, 'confirm']);
|
|
|
|
Route::get('/mfa/backup_codes/generate', [AccessControllers\MfaBackupCodesController::class, 'generate']);
|
|
|
|
Route::post('/mfa/backup_codes/confirm', [AccessControllers\MfaBackupCodesController::class, 'confirm']);
|
2021-08-03 05:02:25 +08:00
|
|
|
});
|
2021-10-31 04:29:59 +08:00
|
|
|
Route::middleware('guest')->group(function () {
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/mfa/verify', [AccessControllers\MfaController::class, 'verify']);
|
|
|
|
Route::post('/mfa/totp/verify', [AccessControllers\MfaTotpController::class, 'verify']);
|
|
|
|
Route::post('/mfa/backup_codes/verify', [AccessControllers\MfaBackupCodesController::class, 'verify']);
|
2021-08-03 05:02:25 +08:00
|
|
|
});
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::delete('/mfa/{method}/remove', [AccessControllers\MfaController::class, 'remove'])->middleware('auth');
|
2021-07-18 23:52:31 +08:00
|
|
|
|
2016-09-18 01:22:04 +08:00
|
|
|
// Social auth routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/login/service/{socialDriver}', [AccessControllers\SocialController::class, 'login']);
|
|
|
|
Route::get('/login/service/{socialDriver}/callback', [AccessControllers\SocialController::class, 'callback']);
|
|
|
|
Route::post('/login/service/{socialDriver}/detach', [AccessControllers\SocialController::class, 'detach'])->middleware('auth');
|
|
|
|
Route::get('/register/service/{socialDriver}', [AccessControllers\SocialController::class, 'register']);
|
2015-09-05 03:40:36 +08:00
|
|
|
|
2015-08-23 22:46:02 +08:00
|
|
|
// Login/Logout routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/login', [AccessControllers\LoginController::class, 'getLogin']);
|
|
|
|
Route::post('/login', [AccessControllers\LoginController::class, 'login']);
|
|
|
|
Route::post('/logout', [AccessControllers\LoginController::class, 'logout']);
|
|
|
|
Route::get('/register', [AccessControllers\RegisterController::class, 'getRegister']);
|
|
|
|
Route::get('/register/confirm', [AccessControllers\ConfirmEmailController::class, 'show']);
|
|
|
|
Route::get('/register/confirm/awaiting', [AccessControllers\ConfirmEmailController::class, 'showAwaiting']);
|
|
|
|
Route::post('/register/confirm/resend', [AccessControllers\ConfirmEmailController::class, 'resend']);
|
|
|
|
Route::get('/register/confirm/{token}', [AccessControllers\ConfirmEmailController::class, 'showAcceptForm']);
|
2024-05-20 21:00:58 +08:00
|
|
|
Route::post('/register/confirm/accept', [AccessControllers\ConfirmEmailController::class, 'confirm'])->middleware('throttle:public');
|
|
|
|
Route::post('/register', [AccessControllers\RegisterController::class, 'postRegister'])->middleware('throttle:public');
|
2015-09-05 00:16:58 +08:00
|
|
|
|
2019-11-17 21:26:43 +08:00
|
|
|
// SAML routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::post('/saml2/login', [AccessControllers\Saml2Controller::class, 'login']);
|
|
|
|
Route::post('/saml2/logout', [AccessControllers\Saml2Controller::class, 'logout']);
|
|
|
|
Route::get('/saml2/metadata', [AccessControllers\Saml2Controller::class, 'metadata']);
|
|
|
|
Route::get('/saml2/sls', [AccessControllers\Saml2Controller::class, 'sls']);
|
|
|
|
Route::post('/saml2/acs', [AccessControllers\Saml2Controller::class, 'startAcs'])->withoutMiddleware([
|
2021-12-07 22:55:11 +08:00
|
|
|
StartSession::class,
|
|
|
|
ShareErrorsFromSession::class,
|
|
|
|
VerifyCsrfToken::class,
|
2021-11-15 05:13:24 +08:00
|
|
|
]);
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/saml2/acs', [AccessControllers\Saml2Controller::class, 'processAcs']);
|
2019-11-17 21:26:43 +08:00
|
|
|
|
2021-10-07 06:05:26 +08:00
|
|
|
// OIDC routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::post('/oidc/login', [AccessControllers\OidcController::class, 'login']);
|
|
|
|
Route::get('/oidc/callback', [AccessControllers\OidcController::class, 'callback']);
|
2023-12-06 21:49:53 +08:00
|
|
|
Route::post('/oidc/logout', [AccessControllers\OidcController::class, 'logout']);
|
2020-07-02 05:27:50 +08:00
|
|
|
|
2019-08-18 20:11:30 +08:00
|
|
|
// User invitation routes
|
2024-05-20 21:00:58 +08:00
|
|
|
Route::get('/register/invite/{token}', [AccessControllers\UserInviteController::class, 'showSetPassword'])->middleware('throttle:public');
|
|
|
|
Route::post('/register/invite/{token}', [AccessControllers\UserInviteController::class, 'setPassword'])->middleware('throttle:public');
|
2019-08-18 20:11:30 +08:00
|
|
|
|
2022-02-08 07:19:04 +08:00
|
|
|
// Password reset link request routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/password/email', [AccessControllers\ForgotPasswordController::class, 'showLinkRequestForm']);
|
2024-05-20 21:00:58 +08:00
|
|
|
Route::post('/password/email', [AccessControllers\ForgotPasswordController::class, 'sendResetLinkEmail'])->middleware('throttle:public');
|
2016-09-18 01:22:04 +08:00
|
|
|
|
2022-02-08 07:19:04 +08:00
|
|
|
// Password reset routes
|
2023-05-19 03:53:39 +08:00
|
|
|
Route::get('/password/reset/{token}', [AccessControllers\ResetPasswordController::class, 'showResetForm']);
|
2024-05-20 21:00:58 +08:00
|
|
|
Route::post('/password/reset', [AccessControllers\ResetPasswordController::class, 'reset'])->middleware('throttle:public');
|
2018-05-20 00:01:33 +08:00
|
|
|
|
2022-02-08 07:19:04 +08:00
|
|
|
// Metadata routes
|
|
|
|
Route::view('/help/wysiwyg', 'help.wysiwyg');
|
|
|
|
|
2024-03-24 00:31:13 +08:00
|
|
|
Route::fallback([MetaController::class, 'notFound'])->name('fallback');
|