You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <?php
  2. use App\Http\Controllers\CollectionController;
  3. use App\Http\Controllers\FileController;
  4. use Illuminate\Support\Facades\Route;
  5. /*
  6. |--------------------------------------------------------------------------
  7. | API Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here is where you can register API routes for your application. These
  11. | routes are loaded by the RouteServiceProvider within a group which
  12. | is assigned the "api" middleware group. Enjoy building your API!
  13. |
  14. */
  15. // Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
  16. // return $request->user();
  17. // });
  18. Route::group(['as' => 'api.'], function () {
  19. Route::apiResource('collections', CollectionController::class);
  20. Route::delete('collections/{collection}', [CollectionController::class, "destroy"])->withTrashed();
  21. Route::get('{collection_name}/{uuid}.{extention}', [FileController::class, 'show'])->name('file.show');
  22. Route::get('{collection_name}/{path}', [FileController::class, 'private'])->name('file.private');
  23. Route::post('{collection_name}/{model_id?}', [FileController::class, 'store'])->name('file.store');
  24. });