<?php

use Illuminate\Support\Facades\Route;
use Src\Modules\Auth\Laravel\AuthMiddleware;
use Src\Modules\Auth\Laravel\UsersProviderMiddleware;

Route::group(['middleware' => [UsersProviderMiddleware::class]], function () {
    require __DIR__ . '/../src/Common/Laravel/routes.php';
    require __DIR__ . '/../src/Modules/Auth/Laravel/loginRoutes.php';
});

Route::group(['middleware' => [UsersProviderMiddleware::class, AuthMiddleware::class]], function () {
    require __DIR__ . '/../src/Common/Laravel/routes.php';
    require __DIR__ . '/../src/Modules/Auth/Laravel/routes.php';
    require __DIR__ . '/../src/Modules/JsonObjects/Laravel/routes.php';
});

Route::get('/', function () {
    return view('welcome');
})->name('home');
