user(); })->middleware('auth:sanctum'); Route::get('', function () { return 'xshop api:'.config('app.name'); }); Route::get('/clear', function () { if (!auth()->check()){ return abort(403); } Artisan::call('cache:clear'); Artisan::call('config:clear'); Artisan::call('config:cache'); Artisan::call('view:clear'); Artisan::call('route:clear'); return "Cleared!"; }); Route::prefix('v1')->name('v1.')->group( function () { Route::get('', function () { return 'xShop api v1'; }); Route::get('states', [\App\Http\Controllers\Api\StateController::class,'index'])->name('state.index'); Route::get('state/{state}', [\App\Http\Controllers\Api\StateController::class,'show'])->name('state.show'); Route::get('category/props/{category}', [\App\Http\Controllers\Api\CategoryController::class,'props'])->name('category.prop'); });