Код: Выделить всё
class AuthenticationServiceProvider extends ServiceProvider
{
public function boot(): void
{
$this->registerRoutes();
}
public function register()
{
// .....
}
protected function registerRoutes(): void
{
Route::middleware('api')
->prefix('api')
->namespace('App\\Modules\\Authentication\\Http\\Controllers\\')
->group(__DIR__ . '/../Authentication/routes/api/auth.php');
}
}
Код: Выделить всё
Route::group(['middleware' => ['api.auth'], 'prefix' => 'auth'], function () {
Route::post('register', [AuthenticationController::class, 'register'])->name('auth.register')->withoutMiddleware('api.auth');
Route::post('login', [AuthenticationController::class, 'login'])->name('auth.login')->withoutMiddleware('api.auth');
Route::get('refresh', [AuthenticationController::class, 'refresh'])->name('auth.refresh')->withoutMiddleware('api.auth');
Route::get('logout', [AuthenticationController::class, 'logout'])->name('auth.logout');
Route::get('get-authenticated', [AuthenticationController::class, 'getAuthenticated'])->name('customers.get-authenticated');
});
Это мой web.php:
Код: Выделить всё
Route::any('{all}', function () {
return view('welcome');
})
->where('all', '^(?!api).*$')
->where('all', '^(?!storage).*$');
Как решить эту проблему?
Подробнее здесь: https://stackoverflow.com/questions/788 ... ailable-on