group(function () { Route::middleware('auth:api')->group(function () { Route::get('links/check', LinkCheckController::class) ->name('api.links.check'); Route::apiResource('links', LinkController::class) ->names([ 'index' => 'api.links.index', 'show' => 'api.links.show', 'store' => 'api.links.store', 'update' => 'api.links.update', 'destroy' => 'api.links.destroy', ]); Route::get('links/{link}/notes', LinkNotesController::class) ->name('api.links.notes'); Route::apiResource('lists', ListController::class) ->names([ 'index' => 'api.lists.index', 'show' => 'api.lists.show', 'store' => 'api.lists.store', 'update' => 'api.lists.update', 'destroy' => 'api.lists.destroy', ]); Route::get('lists/{list}/links', ListLinksController::class) ->name('api.lists.links'); Route::apiResource('tags', TagController::class) ->names([ 'index' => 'api.tags.index', 'show' => 'api.tags.show', 'store' => 'api.tags.store', 'update' => 'api.tags.update', 'destroy' => 'api.tags.destroy', ]); Route::get('tags/{tag}/links', TagLinksController::class) ->name('api.tags.links'); Route::apiResource('notes', NoteController::class) ->names([ 'store' => 'api.notes.store', 'update' => 'api.notes.update', 'destroy' => 'api.notes.destroy', ]) ->except(['index', 'show']); Route::get('search/links', [SearchController::class, 'searchLinks']) ->name('api.search.links'); Route::get('search/tags', [SearchController::class, 'searchByTags']) ->name('api.search.tags'); Route::get('search/lists', [SearchController::class, 'searchByLists']) ->name('api.search.lists'); Route::get('trash/links', [TrashController::class, 'getLinks']) ->name('api.trash.links'); Route::get('trash/lists', [TrashController::class, 'getLists']) ->name('api.trash.lists'); Route::get('trash/tags', [TrashController::class, 'getTags']) ->name('api.trash.tags'); Route::get('trash/notes', [TrashController::class, 'getNotes']) ->name('api.trash.notes'); Route::delete('trash/clear', [TrashController::class, 'clear']) ->name('api.trash.clear'); Route::patch('trash/restore', [TrashController::class, 'restore']) ->name('api.trash.restore'); }); });