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