<?php

use Illuminate\Support\Facades\Route;

// --------------------------
// Custom Backpack Routes
// --------------------------
// This route file is loaded automatically by Backpack\CRUD.
// Routes you generate using Backpack\Generators will be placed here.

Route::group([
    'prefix' => config('backpack.base.route_prefix', 'admin'),
    'middleware' => array_merge(
        (array) config('backpack.base.web_middleware', 'web'),
        (array) config('backpack.base.middleware_key', 'admin')
    ),
    'namespace' => 'App\Http\Controllers\Admin',
], function () { // custom admin routes
    Route::get('storage/{file_path}', [App\Http\Controllers\Admin\StorageController::class, 'serve'])
        ->where('file_path', '.*') // Allow multi-level paths (e.g., documents/subfolder/file.pdf)
        ->name('storage.serve');
    Route::post('storage/image-rotation90/{file_path}', [App\Http\Controllers\Admin\StorageController::class, 'imageRotation90'])
        ->where('file_path', '.*') // Allow multi-level paths (e.g., documents/subfolder/file.pdf)
        ->name('storage.image-rotation90');

    Route::crud('user', 'UserCrudController');
    Route::crud('event-registration-info', 'EventRegistrationInfoCrudController');
    Route::crud('event-metabolism', 'EventMetabolismCrudController');
    Route::crud('event-improved-health', 'EventImprovedHealthCrudController');
    Route::crud('event-health-allowance', 'EventHealthAllowanceCrudController');
    Route::crud('news-catalog', 'NewsCatalogCrudController');
    Route::crud('news', 'NewsCrudController');
    Route::crud('health-info-catalog', 'HealthInfoCatalogCrudController');
    Route::crud('health-info', 'HealthInfoCrudController');
    Route::crud('notice-catalog', 'NoticeCatalogCrudController');
    Route::crud('notice', 'NoticeCrudController');
    Route::crud('faq-catalog', 'FaqCatalogCrudController');
    Route::crud('faq', 'FaqCrudController');
}); // this should be the absolute last line of this file

/**
 * DO NOT ADD ANYTHING HERE.
 */
