admin-panel

This commit is contained in:
2026-01-12 11:37:40 +00:00
parent e400b203b8
commit 2a83373b28
18 changed files with 507 additions and 2329 deletions

View File

@@ -0,0 +1,53 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to your application's route files.
*
* @var string
*/
protected $routesPath;
/**
* Define your route model bindings, pattern filters, and other route configuration.
*
* @return void
*/
public function boot()
{
$this->configureRateLimiting();
// Установите путь к маршрутам
$this->routesPath = base_path('routes');
$this->routes(function () {
Route::middleware('web')
->group($this->routesPath . '/web.php');
Route::middleware(['web', 'auth'])
->prefix('admin')
->group($this->routesPath . '/admin.php');
});
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
}
}