2018-08-22 20:54:44 +02:00
|
|
|
<?php
|
|
|
|
|
2020-01-28 13:47:00 +01:00
|
|
|
use App\Http\Controllers\App\BookmarkletController;
|
|
|
|
use App\Http\Controllers\App\DashboardController;
|
|
|
|
use App\Http\Controllers\App\ExportController;
|
|
|
|
use App\Http\Controllers\App\ImportController;
|
|
|
|
use App\Http\Controllers\App\SearchController;
|
|
|
|
use App\Http\Controllers\App\SystemSettingsController;
|
|
|
|
use App\Http\Controllers\App\TrashController;
|
|
|
|
use App\Http\Controllers\App\UserSettingsController;
|
|
|
|
use App\Http\Controllers\Auth\ForgotPasswordController;
|
|
|
|
use App\Http\Controllers\Auth\LoginController;
|
|
|
|
use App\Http\Controllers\Auth\ResetPasswordController;
|
2020-03-09 20:00:29 +01:00
|
|
|
use App\Http\Controllers\CronController;
|
|
|
|
use App\Http\Controllers\FetchController;
|
2020-01-28 13:47:00 +01:00
|
|
|
use App\Http\Controllers\FrontController;
|
|
|
|
use App\Http\Controllers\Guest\LinkController as GuestLinkController;
|
|
|
|
use App\Http\Controllers\Guest\ListController as GuestListController;
|
|
|
|
use App\Http\Controllers\Guest\TagController as GuestTagController;
|
|
|
|
use App\Http\Controllers\Models\LinkController;
|
|
|
|
use App\Http\Controllers\Models\ListController;
|
|
|
|
use App\Http\Controllers\Models\NoteController;
|
|
|
|
use App\Http\Controllers\Models\TagController;
|
|
|
|
use App\Http\Controllers\Setup\AccountController;
|
|
|
|
use App\Http\Controllers\Setup\DatabaseController;
|
|
|
|
use App\Http\Controllers\Setup\MetaController;
|
|
|
|
use App\Http\Controllers\Setup\RequirementsController;
|
2019-09-16 18:33:28 +02:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2018-08-22 20:54:44 +02:00
|
|
|
|
2020-01-28 13:47:00 +01:00
|
|
|
// Frontpage
|
|
|
|
Route::get('/', FrontController::class)->name('front');
|
2018-08-22 21:10:24 +02:00
|
|
|
|
2019-09-16 18:33:28 +02:00
|
|
|
// Setup routes
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::get('setup/start', [MetaController::class, 'welcome'])
|
|
|
|
->name('setup.welcome');
|
|
|
|
Route::get('setup/requirements', [RequirementsController::class, 'index'])
|
|
|
|
->name('setup.requirements');
|
|
|
|
Route::get('setup/database', [DatabaseController::class, 'index'])
|
|
|
|
->name('setup.database');
|
|
|
|
Route::post('setup/database', [DatabaseController::class, 'configure'])
|
|
|
|
->name('setup.database');
|
|
|
|
Route::get('setup/account', [AccountController::class, 'index'])
|
|
|
|
->name('setup.account');
|
|
|
|
Route::post('setup/account', [AccountController::class, 'register'])
|
|
|
|
->name('setup.account');
|
|
|
|
Route::get('setup/complete', [MetaController::class, 'complete'])
|
|
|
|
->name('setup.complete');
|
2019-09-16 18:33:28 +02:00
|
|
|
|
2018-08-22 22:38:43 +02:00
|
|
|
// Authentication Routes
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::get('login', [LoginController::class, 'showLoginForm'])->name('login');
|
|
|
|
Route::post('login', [LoginController::class, 'login']);
|
|
|
|
Route::post('logout', [LoginController::class, 'logout'])->name('logout');
|
2018-08-22 22:38:43 +02:00
|
|
|
|
|
|
|
// Registration Routes (disabled, use the `artisan registeruser` command)
|
2019-01-10 22:39:01 +01:00
|
|
|
//Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
|
|
|
|
//Route::post('register', 'Auth\RegisterController@register');
|
2018-08-22 22:38:43 +02:00
|
|
|
|
|
|
|
// Password Reset Routes
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::get('password/reset', [ForgotPasswordController::class, 'showLinkRequestForm'])
|
|
|
|
->name('password.request');
|
|
|
|
Route::post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail'])
|
|
|
|
->name('password.email');
|
|
|
|
Route::get('password/reset/{token}', [ResetPasswordController::class, 'showResetForm'])
|
|
|
|
->name('password.reset');
|
|
|
|
Route::post('password/reset', [ResetPasswordController::class, 'reset']);
|
2019-01-10 22:39:01 +01:00
|
|
|
|
2019-01-10 23:42:19 +01:00
|
|
|
// Bookmarklet routes
|
2019-01-10 22:39:01 +01:00
|
|
|
Route::prefix('bookmarklet')->group(function () {
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::get('add', [BookmarkletController::class, 'getLinkAddForm'])
|
|
|
|
->name('bookmarklet-add');
|
|
|
|
Route::get('show', [BookmarkletController::class, 'getCompleteView'])
|
|
|
|
->name('bookmarklet-complete');
|
|
|
|
Route::get('login', [BookmarkletController::class, 'getLoginForm'])
|
|
|
|
->name('bookmarklet-login');
|
2019-01-10 22:39:01 +01:00
|
|
|
});
|
2018-08-22 21:10:24 +02:00
|
|
|
|
2020-01-28 16:11:42 +01:00
|
|
|
Route::get('cron/{token}', CronController::class)->name('cron');
|
2019-02-11 00:04:04 +01:00
|
|
|
|
2018-08-23 01:09:48 +02:00
|
|
|
// Model routes
|
2018-08-23 10:37:15 +02:00
|
|
|
Route::group(['middleware' => ['auth']], function () {
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::get('dashboard', [DashboardController::class, 'index'])
|
|
|
|
->name('dashboard');
|
|
|
|
|
|
|
|
Route::resource('links', LinkController::class);
|
|
|
|
Route::resource('lists', ListController::class);
|
|
|
|
Route::resource('tags', TagController::class);
|
|
|
|
Route::resource('notes', NoteController::class)
|
|
|
|
->except(['index', 'show']);
|
|
|
|
|
2020-02-28 17:14:41 +01:00
|
|
|
Route::post('links/toggle-check/{id}', [LinkController::class, 'updateCheckToggle'])
|
|
|
|
->name('links.toggle-check');
|
|
|
|
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::get('search', [SearchController::class, 'getSearch'])
|
|
|
|
->name('get-search');
|
|
|
|
Route::post('search', [SearchController::class, 'doSearch'])
|
|
|
|
->name('do-search');
|
|
|
|
|
|
|
|
Route::get('import', [ImportController::class, 'getImport'])
|
|
|
|
->name('get-import');
|
|
|
|
Route::post('import', [ImportController::class, 'doImport'])
|
|
|
|
->name('do-import');
|
|
|
|
|
|
|
|
Route::get('export', [ExportController::class, 'getExport'])
|
|
|
|
->name('get-export');
|
2020-06-03 15:38:44 +02:00
|
|
|
Route::post('export/html', [ExportController::class, 'doHtmlExport'])
|
|
|
|
->name('do-html-export');
|
|
|
|
Route::post('export/csv', [ExportController::class, 'doCsvExport'])
|
|
|
|
->name('do-csv-export');
|
2020-01-28 13:47:00 +01:00
|
|
|
|
|
|
|
Route::get('trash', [TrashController::class, 'index'])
|
|
|
|
->name('get-trash');
|
|
|
|
Route::get('trash/clear/{model}', [TrashController::class, 'clearTrash'])
|
|
|
|
->name('clear-trash');
|
|
|
|
Route::get('trash/restore/{model}/{id}', [TrashController::class, 'restoreEntry'])
|
|
|
|
->name('trash-restore');
|
|
|
|
|
|
|
|
Route::get('settings', [UserSettingsController::class, 'getUserSettings'])
|
|
|
|
->name('get-usersettings');
|
|
|
|
Route::post('settings/account', [UserSettingsController::class, 'saveAccountSettings'])
|
|
|
|
->name('save-settings-account');
|
|
|
|
Route::post('settings/app', [UserSettingsController::class, 'saveAppSettings'])
|
|
|
|
->name('save-settings-app');
|
|
|
|
Route::post('settings/change-password', [UserSettingsController::class, 'changeUserPassword'])
|
|
|
|
->name('change-user-password');
|
|
|
|
Route::post('settings/generate-api-token', [UserSettingsController::class, 'generateApiToken'])
|
|
|
|
->name('generate-api-token');
|
|
|
|
|
|
|
|
Route::get('settings/system', [SystemSettingsController::class, 'getSystemSettings'])
|
|
|
|
->name('get-sysstemsettings');
|
|
|
|
Route::post('settings/system', [SystemSettingsController::class, 'saveSystemSettings'])
|
|
|
|
->name('save-settings-system');
|
|
|
|
Route::post('settings/generate-cron-token', [SystemSettingsController::class, 'generateCronToken'])
|
|
|
|
->name('generate-cron-token');
|
|
|
|
|
2020-01-28 13:58:18 +01:00
|
|
|
Route::post('fetch/tags', [FetchController::class, 'getTags'])
|
|
|
|
->name('fetch-tags');
|
|
|
|
Route::post('fetch/lists', [FetchController::class, 'getLists'])
|
|
|
|
->name('fetch-lists');
|
|
|
|
Route::post('fetch/existing-links', [FetchController::class, 'searchExistingUrls'])
|
|
|
|
->name('fetch-existing-links');
|
2020-03-04 14:53:31 +01:00
|
|
|
Route::get('fetch/update-check', [FetchController::class, 'checkForUpdates'])
|
|
|
|
->name('fetch-update-check');
|
2018-08-23 10:37:15 +02:00
|
|
|
});
|
|
|
|
|
2019-01-10 23:42:19 +01:00
|
|
|
// Guest access routes
|
2019-03-01 21:13:10 +01:00
|
|
|
Route::prefix('guest')->middleware(['guestaccess'])->group(function () {
|
|
|
|
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::resource('lists', GuestListController::class)
|
2019-11-28 11:59:41 +01:00
|
|
|
->only(['index', 'show'])
|
2019-03-01 21:13:10 +01:00
|
|
|
->names([
|
2019-11-28 11:59:41 +01:00
|
|
|
'index' => 'guest.lists.index',
|
|
|
|
'show' => 'guest.lists.show',
|
2019-03-01 21:13:10 +01:00
|
|
|
]);
|
|
|
|
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::resource('links', GuestLinkController::class)
|
2019-03-01 21:13:10 +01:00
|
|
|
->only(['index'])
|
|
|
|
->names([
|
|
|
|
'index' => 'guest.links.index',
|
|
|
|
]);
|
|
|
|
|
2020-01-28 13:47:00 +01:00
|
|
|
Route::resource('tags', GuestTagController::class)
|
2019-03-01 21:13:10 +01:00
|
|
|
->only(['show'])
|
|
|
|
->names([
|
|
|
|
'show' => 'guest.tags.show',
|
|
|
|
]);
|
|
|
|
});
|