1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-11-24 20:02:35 +01:00
BookStack/routes/web.php

185 lines
10 KiB
PHP
Raw Normal View History

2015-07-12 21:01:42 +02:00
<?php
Route::get('/translations', 'HomeController@getTranslations');
// Authenticated routes...
2015-08-29 16:03:42 +02:00
Route::group(['middleware' => 'auth'], function () {
2015-08-05 21:59:39 +02:00
Route::group(['prefix' => 'pages'], function() {
Route::get('/recently-created', 'PageController@showRecentlyCreated');
Route::get('/recently-updated', 'PageController@showRecentlyUpdated');
});
2015-08-29 16:03:42 +02:00
Route::group(['prefix' => 'books'], function () {
2015-08-05 21:59:39 +02:00
2015-08-09 13:06:52 +02:00
// Books
2015-08-05 21:59:39 +02:00
Route::get('/', 'BookController@index');
Route::get('/create', 'BookController@create');
Route::post('/', 'BookController@store');
Route::get('/{slug}/edit', 'BookController@edit');
Route::put('/{slug}', 'BookController@update');
Route::delete('/{id}', 'BookController@destroy');
2015-09-06 15:35:53 +02:00
Route::get('/{slug}/sort-item', 'BookController@getSortItem');
2015-08-05 21:59:39 +02:00
Route::get('/{slug}', 'BookController@show');
Route::get('/{bookSlug}/permissions', 'BookController@showRestrict');
Route::put('/{bookSlug}/permissions', 'BookController@restrict');
2015-08-05 21:59:39 +02:00
Route::get('/{slug}/delete', 'BookController@showDelete');
2015-09-06 15:35:53 +02:00
Route::get('/{bookSlug}/sort', 'BookController@sort');
Route::put('/{bookSlug}/sort', 'BookController@saveSort');
Route::get('/{bookSlug}/export/html', 'BookController@exportHtml');
Route::get('/{bookSlug}/export/pdf', 'BookController@exportPdf');
Route::get('/{bookSlug}/export/plaintext', 'BookController@exportPlainText');
2015-09-06 15:35:53 +02:00
2015-08-09 13:06:52 +02:00
// Pages
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/page/create', 'PageController@create');
Route::post('/{bookSlug}/page/create/guest', 'PageController@createAsGuest');
Route::get('/{bookSlug}/draft/{pageId}', 'PageController@editDraft');
Route::post('/{bookSlug}/draft/{pageId}', 'PageController@store');
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
2016-01-20 23:13:13 +01:00
Route::get('/{bookSlug}/page/{pageSlug}/export/pdf', 'PageController@exportPdf');
Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageController@exportHtml');
Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageController@exportPlainText');
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
Route::get('/{bookSlug}/page/{pageSlug}/move', 'PageController@showMove');
2016-06-12 13:14:14 +02:00
Route::put('/{bookSlug}/page/{pageSlug}/move', 'PageController@move');
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete');
Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft');
Route::get('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@showRestrict');
Route::put('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@restrict');
2015-08-05 21:59:39 +02:00
Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy');
Route::delete('/{bookSlug}/draft/{pageId}', 'PageController@destroyDraft');
2016-01-20 23:13:13 +01:00
// Revisions
2015-08-09 13:06:52 +02:00
Route::get('/{bookSlug}/page/{pageSlug}/revisions', 'PageController@showRevisions');
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', 'PageController@showRevision');
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', 'PageController@showRevisionChanges');
2015-08-09 13:06:52 +02:00
Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', 'PageController@restoreRevision');
2015-08-05 21:59:39 +02:00
2015-08-09 13:06:52 +02:00
// Chapters
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create');
Route::post('/{bookSlug}/chapter/{chapterSlug}/page/create/guest', 'PageController@createAsGuest');
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/chapter/create', 'ChapterController@create');
Route::post('/{bookSlug}/chapter/create', 'ChapterController@store');
Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show');
Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update');
2016-06-25 16:31:38 +02:00
Route::get('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@showMove');
Route::put('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@move');
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit');
Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@showRestrict');
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');
Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@restrict');
2015-08-05 21:59:39 +02:00
Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
});
2016-02-16 22:25:11 +01:00
// User Profile routes
Route::get('/user/{userId}', 'UserController@showProfilePage');
2015-08-08 21:05:30 +02:00
// Image routes
Route::group(['prefix' => 'images'], function() {
2015-12-09 23:30:55 +01:00
// Get for user images
Route::get('/user/all', 'ImageController@getAllForUserType');
Route::get('/user/all/{page}', 'ImageController@getAllForUserType');
// Standard get, update and deletion for all types
Route::get('/thumb/{id}/{width}/{height}/{crop}', 'ImageController@getThumbnail');
Route::put('/update/{imageId}', 'ImageController@update');
Route::post('/{type}/upload', 'ImageController@uploadByType');
Route::get('/{type}/all', 'ImageController@getAllByType');
Route::get('/{type}/all/{page}', 'ImageController@getAllByType');
Route::get('/{type}/search/{page}', 'ImageController@searchByType');
Route::get('/gallery/{filter}/{page}', 'ImageController@getGalleryFiltered');
Route::delete('/{imageId}', 'ImageController@destroy');
});
2015-07-12 21:01:42 +02:00
2016-11-12 15:12:26 +01: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-05-06 21:33:08 +02:00
// AJAX routes
Route::put('/ajax/page/{id}/save-draft', 'PageController@saveDraft');
2016-03-12 16:52:19 +01:00
Route::get('/ajax/page/{id}', 'PageController@getPageAjax');
Route::delete('/ajax/page/{id}', 'PageController@ajaxDestroy');
// Tag routes (AJAX)
Route::group(['prefix' => 'ajax/tags'], function() {
Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
Route::get('/suggest/names', 'TagController@getNameSuggestions');
Route::get('/suggest/values', 'TagController@getValueSuggestions');
2016-05-06 21:33:08 +02:00
});
2016-06-12 13:14:14 +02:00
Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
2015-08-08 21:05:30 +02:00
// Links
2015-08-05 21:59:39 +02:00
Route::get('/link/{id}', 'PageController@redirectFromLink');
2015-08-08 21:05:30 +02:00
// Search
Route::get('/search/all', 'SearchController@searchAll');
Route::get('/search/pages', 'SearchController@searchPages');
Route::get('/search/books', 'SearchController@searchBooks');
Route::get('/search/chapters', 'SearchController@searchChapters');
Route::get('/search/book/{bookId}', 'SearchController@searchBook');
2015-07-13 22:52:56 +02:00
// Other Pages
Route::get('/', 'HomeController@index');
Route::get('/home', 'HomeController@index');
2015-07-13 22:52:56 +02:00
// Settings
2016-02-16 22:25:11 +01:00
Route::group(['prefix' => 'settings'], function() {
Route::get('/', 'SettingController@index')->name('settings');
2016-02-16 22:25:11 +01:00
Route::post('/', 'SettingController@update');
2016-02-16 22:25:11 +01:00
// Users
Route::get('/users', 'UserController@index');
Route::get('/users/create', 'UserController@create');
Route::get('/users/{id}/delete', 'UserController@delete');
Route::post('/users/create', 'UserController@store');
Route::get('/users/{id}', 'UserController@edit');
Route::put('/users/{id}', 'UserController@update');
Route::delete('/users/{id}', 'UserController@destroy');
// Roles
Route::get('/roles', 'PermissionController@listRoles');
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');
Route::get('/roles/{id}', 'PermissionController@editRole');
Route::put('/roles/{id}', 'PermissionController@updateRole');
2016-02-16 22:25:11 +01:00
});
2015-07-12 21:01:42 +02:00
});
2015-08-05 22:16:10 +02:00
// Social auth routes
2016-11-27 20:11:15 +01:00
Route::get('/login/service/{socialDriver}', 'Auth\LoginController@getSocialLogin');
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 21:40:36 +02:00
// Login/Logout routes
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 18:16:58 +02:00
// Password reset link request routes...
Route::get('/password/email', 'Auth\ForgotPasswordController@showLinkRequestForm');
Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
// Password reset routes...
Route::get('/password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
Route::post('/password/reset', 'Auth\ResetPasswordController@reset');