{"id":379757,"date":"2024-06-25T03:45:16","date_gmt":"2024-06-25T03:45:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=379757"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=379757","title":{"rendered":"<span>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u0432 Laravel 11<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/articles\/785026\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u043f\u043e\u0441\u0442\u043e\u0432<\/a> \u0431\u044b\u043b\u043e \u043e\u0437\u0432\u0443\u0447\u0435\u043d\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0435\u0439 \u0432 Laravel 11 \u0434\u043e \u0435\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430. \u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u0438 \u0441 \u0447\u0435\u043c \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f &#171;\u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0430&#187; \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Laravel \u0432\u0435\u0440\u0441\u0438\u0438 11 &#8212; &#171;<a href=\"https:\/\/github.com\/laravel\/framework\/pull\/47309\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u043e\u0441\u043a\u0438\u0439 \u043a\u043e\u0434<\/a>&#171;. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0443\u0431\u0440\u0430\u043d\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0435\u0441\u044f &#171;\u043c\u0443\u0441\u043e\u0440\u043e\u043c&#187;. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443\u0431\u0440\u0430\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0422\u043e, \u0447\u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0444\u0430\u0439\u043b <code>bootstrap\/providers.php<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u043e\u0443\u0442\u043e\u0432, \u043a\u043e\u043c\u0430\u043d\u0434, \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u044c, \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0444\u0430\u0439\u043b <code>bootstrap\/app.php<\/code> (\u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <code>app\/Http\/Kernel.php<\/code>, \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u044b \u0432 <code>app\/Exceptions\/Handler.php<\/code>, \u043a\u0440\u043e\u043d-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 <code>app\/Console\/Kernel.php<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0446\u0438\u044f \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043a\u044d\u0448\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u0441 <code>CACHE_DRIVER<\/code> \u043d\u0430 <code>CACHE_STORE<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438 \u043a\u0430\u043a \u043c\u044b \u0441 \u044d\u0442\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c.<\/p>\n<h2>bootstrap\/app.php<\/h2>\n<p>\u0421\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e-\u043f\u0440\u0430\u0432\u0434\u0435, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0438 \u043d\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.php.net\/manual\/ru\/language.oop5.magic.php#object.invoke\" rel=\"noopener noreferrer nofollow\">invoke<\/a> \u043a\u043b\u0430\u0441\u0441\u044b.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435, \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Console\\Handler as ScheduleHandler; use App\\Exceptions\\Handler as ExceptionHandler; use App\\Http\\Middleware\\Handler as MiddlewareHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withMiddleware(new MiddlewareHandler())     ->withExceptions(new ExceptionHandler())     ->withSchedule(new ScheduleHandler())     ->withCommands([__DIR__ . '\/..\/app\/Console\/Commands'])     ->withRouting(         api: __DIR__ . '\/..\/routes\/api.php',         commands: __DIR__ . '\/..\/routes\/console.php',         apiPrefix: ''     )->create();<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u043a API \u0438 \u0432 \u043d\u0451\u043c \u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u0439 \u043a\u0430\u043a <code>web<\/code>, <code>blade<\/code>, <code>html<\/code>, <code>ts\/js<\/code> \u0438 \u0442.\u043f., \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0438\u0445 \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <code>api<\/code> \u0443 \u0432\u0441\u0435\u0445 \u0440\u043e\u0443\u0442\u043e\u0432 \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0435\u0433\u043e &#171;\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c&#187;.<\/p>\n<h2>\u041c\u0438\u0434\u043b\u0432\u0430\u0440\u0438<\/h2>\n<p>\u041f\u0440\u0438 \u0447\u0438\u0441\u0442\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Laravel \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>bootstrap\/app.php<\/code>, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/www.php.net\/manual\/ru\/language.oop5.magic.php#object.invoke\" rel=\"noopener noreferrer nofollow\">invoke<\/a> \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace App\\Http\\Middleware;  use App\\Http\\Middleware\\Authorizations\\AuthInternalMiddleware; use App\\Http\\Middleware\\Authorizations\\AuthPrivateMiddleware; use App\\Http\\Middleware\\Authorizations\\AuthPublicMiddleware; use Illuminate\\Foundation\\Configuration\\Middleware as BaseMiddleware;  class Handler {     protected array $aliases = [         'auth.private'  => AuthPrivateMiddleware::class,         'auth.public'   => AuthPublicMiddleware::class,         'auth.internal' => AuthInternalMiddleware::class,     ];      public function __invoke(BaseMiddleware $middleware): BaseMiddleware     {         if ($this->aliases) {             $middleware->alias($this->aliases);         }          return $middleware;     } }<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0430\u043b\u0438\u0430\u0441\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438 \u0438 \u0432\u0441\u0435\u043c, \u0447\u0442\u043e \u0443\u043c\u0435\u044e\u0442 &#171;\u043e\u0431\u044b\u0447\u043d\u044b\u0435&#187; \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0438\u0430\u0441\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0441\u0451 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u044f\u043c\u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0444\u0430\u0439\u043b \u0438 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u0441 Laravel.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withMiddleware<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Http\\Middleware\\Handler as MiddlewareHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withMiddleware(new MiddlewareHandler())     \/\/ ...     ->create();<\/code><\/pre>\n<h2>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a<\/h2>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0441 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u044f\u043c\u0438, \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u044b \u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u0430 <code>app\/Exceptions\/Handler.php<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u0432\u043e\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0444\u0430\u0439\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace App\\Exceptions;  use Illuminate\\Auth\\AuthenticationException; use Illuminate\\Foundation\\Configuration\\Exceptions as BaseExceptions; use Illuminate\\Http\\Request; use Illuminate\\Support\\Facades\\View; use Sentry\\Laravel\\Integration; use Symfony\\Component\\HttpFoundation\\Response; use Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException; use Throwable;  class Handler {     protected string $jsonFlags = JSON_UNESCAPED_SLASHES ^ JSON_UNESCAPED_UNICODE;      public function __invoke(BaseExceptions $exceptions): BaseExceptions     {         $this->renderUnauthorized($exceptions);         $this->renderNotFound($exceptions);          $this->reportSentry($exceptions);          return $exceptions;     }      protected function renderUnauthorized(BaseExceptions $exceptions): void     {         $exceptions->renderable(             fn (AuthenticationException $e, ?Request $request = null) => $this->response(                 message: __('Unauthorized'),                 code: 401,                 asJson: $request?->expectsJson() ?? false             )         );     }      protected function renderNotFound(BaseExceptions $exceptions): void     {         $exceptions->renderable(             fn (NotFoundHttpException $e, ?Request $request = null) => $this->response(                 message: __('Not Found'),                 code: 404,                 asJson: $request?->expectsJson() ?? false             )         );     }      protected function reportSentry(BaseExceptions $exceptions): void     {         $exceptions->reportable(             fn (Throwable $e) => Integration::captureUnhandledException($e)         );     }      protected function response(string $message, int $code, bool $asJson): Response     {         if ($asJson) {             return response()->json(compact('message'), $code, options: $this->jsonFlags);         }          $this->registerErrorViewPaths();          return response()->view($this->view($code), status: $code);     }      protected function view(int $code): string     {         return view()->exists('errors::' . $code) ? 'errors::' . $code : 'errors::400';     }      protected function registerErrorViewPaths(): void     {         View::replaceNamespace(             'errors',             collect(config('view.paths'))                 ->map(fn (string $path) => \"$path\/errors\")                 ->push($this->vendorViews())                 ->all()         );     }      protected function vendorViews(): string     {         return __DIR__ . '\/..\/..\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Exceptions\/views';     } }<\/code><\/pre>\n<p>\u041f\u0443\u0442\u0438 \u043a <code>view<\/code> \u0444\u0430\u043b\u0430\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;404 | \u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e&#187; \u0432\u043c\u0435\u0441\u0442\u043e &#171;404 | Not Found&#187; \u0434\u043b\u044f \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b <code>resources\/views\/errors\/404.blade.php<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"php\">@extends('errors::minimal')  @section('title', __('http-statuses.404')) @section('code',  404) @section('message', __('http-statuses.404'))<\/code><\/pre>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withException<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Exceptions\\Handler as ExceptionHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withExceptions(new ExceptionHandler())     \/\/ ...     ->create();<\/code><\/pre>\n<h2>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e (schedule)<\/h2>\n<p>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0432 Laravel 11 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c &#171;\u043a\u0440\u043e\u043d\u043e\u043c&#187; (cron), \u0441\u0442\u0430\u043b\u0438&#8230; \u0431\u0430\u0440\u0430\u0431\u0430\u043d\u043d\u0430\u044f \u0434\u0440\u043e\u0431\u044c&#8230; \u0420\u041e\u0423\u0422\u0410\u041c\u0418!<\/p>\n<p>\u0414\u0430, \u0412\u044b \u043d\u0435 \u043e\u0441\u043b\u044b\u0448\u0430\u043b\u0438\u0441\u044c. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/laravel.com\/docs\/11.x\/scheduling#introduction\" rel=\"noopener noreferrer nofollow\">\u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c<\/a> \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>routes\/console.php<\/code>.<\/p>\n<p>\u0418 \u043d\u0430\u043c \u0441 \u044d\u0442\u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u043e\u0447\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0444\u0430\u0439\u043b <code>routes\/console.php<\/code> \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0433\u043e \u0446\u0435\u043b\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u044f\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0434\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 &#171;dev&#187; \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 <code>app\/Console\/Commands<\/code>.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>App\\Console\\Handler<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace App\\Console;  use Illuminate\\Cache\\Console\\PruneStaleTagsCommand; use Illuminate\\Console\\Scheduling\\Schedule;  class Handler {     public function __invoke(Schedule $schedule): void     {         $schedule->command(PruneStaleTagsCommand::class)->hourly();          \/\/ ...     } }<\/code><\/pre>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withSchedule<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Console\\Handler as ScheduleHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withSchedule(new ScheduleHandler())     \/\/ ...     ->create();<\/code><\/pre>\n<h2>\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h2>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withCommands<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>. \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 <code>app\/Console<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withCommands([__DIR__ . '\/..\/app\/Console\/Commands'])     \/\/ ...     ->create(); <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u0438 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <code>php artisan &lt;name><\/code>.<\/p>\n<h2>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Laravel \u0442\u0430\u043a\u0436\u0435 \u043b\u0438\u0448\u0438\u043b\u0430\u0441\u044c \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 <code>RouteServiceProvider<\/code> \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043f\u0430\u043f\u043a\u0438 <code>routes<\/code>. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 <code>web<\/code> \u0437\u043e\u043d\u044b, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>routes\/api.php<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0433\u0440\u0443\u043f\u043f:<\/p>\n<pre><code class=\"php\">&lt;?php  app('router')     ->middleware('auth.private')     ->name('private.')     ->prefix('v1\/private')     ->group(__DIR__ . '\/api\/private.php');  app('router')     ->middleware('auth.public')     ->name('public.')     ->prefix('v1\/public')     ->group(__DIR__ . '\/api\/public.php');  app('router')     ->middleware('auth.internal')     ->name('internal.')     ->prefix('v1\/internal')     ->group(__DIR__ . '\/api\/internal.php');<\/code><\/pre>\n<h2>\u0421\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0431\u044b\u043b\u043e \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0444\u0430\u0439\u043b <code>bootstrap\/providers.php<\/code>, \u0441\u0442\u0430\u0440\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0451 \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 <code>array_merge<\/code>.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0443\u044e <code>fallback<\/code> \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e Laravel \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 <code>json<\/code> \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u043d\u0435\u0451. \u0422\u043e \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 <code>__('Whoops!')<\/code> \u043e\u0442\u0434\u0430\u0441\u0442 \u043a\u0430\u043a <code>Whoops!<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>\u0423\u043f\u0441!<\/code>. \u0420\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 <a href=\"https:\/\/laravel-lang.com\/packages-json-fallback.html\" rel=\"noopener noreferrer nofollow\">JSON Fallback<\/a>, \u043d\u043e \u0440\u0435\u0447\u044c \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043d\u0451\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 <code>Illuminate\\Translation\\TranslationServiceProvider<\/code> \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e &#8212; \u0444\u0430\u0439\u043b <code>bootstrap\/providers.php<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a, \u0433\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0430 &#8212; \u043f\u0440\u044f\u043c\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440. \u0410 \u043d\u0430\u043c \u043c\u0430\u043b\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440, \u0434\u0430\u043a \u0435\u0449\u0451 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c. \u0418 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c? &#8212; \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435. \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0430\u0440\u0430\u044f \u043e\u043f\u0446\u0438\u044f <code>providers<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 <code>config\/app.php<\/code>. \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0451, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u0438 \u0432\u0441\u0451. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u0441\u0430\u043c\u043e \u0432\u043e\u0437\u044c\u043c\u0451\u0442 \u0438\u0445, \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044b \u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/providers.php<\/code>, \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435\u043c \u0447\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438.<\/p>\n<pre><code class=\"php\">\/\/ config\/app.php  &lt;?php  use Illuminate\\Support\\ServiceProvider; use Illuminate\\Translation\\TranslationServiceProvider as BaseTranslationServiceProvider; use LaravelLang\\JsonFallback\\TranslationServiceProvider as JsonTranslationServiceProvider;  return [     'name' => env('APP_NAME', 'Laravel'),      \/\/ ...      'providers' => ServiceProvider::defaultProviders()->replace([         BaseTranslationServiceProvider::class => JsonTranslationServiceProvider::class,     ])->toArray(), ]; <\/code><\/pre>\n<p>\u0424\u0438\u0448\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c Laravel \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/laravel\/framework\/blob\/11.x\/src\/Illuminate\/Foundation\/Bootstrap\/RegisterProviders.php#L58-L65\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b<\/a> \u0432 \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0443\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f \u0438\u0445 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0438\u0445 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u043c.<\/p>\n<h2>routes\/console.php<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445 \u0438 \u043e\u043d \u0438\u0441\u043a\u043b\u044e\u0447\u0451\u043d \u0438\u0437 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439.<\/p>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <code>commands<\/code> \u043c\u0435\u0442\u043e\u0434\u0430 <code>withRouting<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 <code>bootstrap\/app.php<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"php\">&lt;?php  use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withRouting(         api: __DIR__ . '\/..\/routes\/api.php',         commands: __DIR__ . '\/..\/routes\/console.php',         apiPrefix: ''     )->create();<\/code><\/pre>\n<p>\u0418 \u0443\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 <code>\/routes\/console.php<\/code> \u0432 \u0444\u0430\u0439\u043b\u0435 <code>.gitignore<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u0430\u043c\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<pre><code class=\"php\">&lt;?php  use Illuminate\\Support\\Facades\\Artisan;  Artisan::command('foo', function () {     dump(         'I like it! Move it! Move it!'     ); });<\/code><\/pre>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0444\u0430\u0439\u043b \u043f\u043e\u043f\u0430\u043b \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0445\u043e\u0442\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0430 \u043d\u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <code>.gitignore<\/code>, \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u043c\u0438\u0442. \u0423\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0430\u0439\u043b\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442 \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<\/blockquote>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412\u0435\u0440\u043d\u0443\u0432 \u0441\u0442\u0430\u0440\u044b\u0435 \u043d\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u0441\u0432\u043e\u0438 \u043c\u0435\u0441\u0442\u0430, \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 Laravel 11:<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0440\u0433\u0430\u043d\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u043e\u0443\u0442\u043e\u0432 \u043a\u0440\u043e\u043d\u043e\u043c;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0438\u0441\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0430 \u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043c\u043e\u0433\u0430\u043b \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u043d\u0435 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0451\u0441 \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u043c \u0445\u043e\u0434\u0443, \u0433\u0434\u0435 \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0437\u0430\u0434\u043d\u0435\u043c \u0441\u0438\u0434\u0435\u043d\u044c\u0435.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0438 \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043b\u0430 \u043c\u0435\u043d\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u043d\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439.<\/p>\n<p>\u0412\u0441\u0435\u0445 \u0431\u043b\u0430\u0433 \u0438 \u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/822185\/\"> https:\/\/habr.com\/ru\/articles\/822185\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/articles\/785026\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u043f\u043e\u0441\u0442\u043e\u0432<\/a> \u0431\u044b\u043b\u043e \u043e\u0437\u0432\u0443\u0447\u0435\u043d\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0435\u0439 \u0432 Laravel 11 \u0434\u043e \u0435\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430. \u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0441 \u0442\u0435\u0445 \u043f\u043e\u0440 \u0438 \u0441 \u0447\u0435\u043c \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f &#171;\u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0430&#187; \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Laravel \u0432\u0435\u0440\u0441\u0438\u0438 11 &#8212; &#171;<a href=\"https:\/\/github.com\/laravel\/framework\/pull\/47309\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u043e\u0441\u043a\u0438\u0439 \u043a\u043e\u0434<\/a>&#171;. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442 \u0443\u0431\u0440\u0430\u043d\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0435\u0441\u044f &#171;\u043c\u0443\u0441\u043e\u0440\u043e\u043c&#187;. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0443\u0431\u0440\u0430\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<h2>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0422\u043e, \u0447\u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438;<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b;<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0444\u0430\u0439\u043b <code>bootstrap\/providers.php<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u043e\u0443\u0442\u043e\u0432, \u043a\u043e\u043c\u0430\u043d\u0434, \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u044c, \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0444\u0430\u0439\u043b <code>bootstrap\/app.php<\/code> (\u0440\u0430\u043d\u044c\u0448\u0435 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 <code>app\/Http\/Kernel.php<\/code>, \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u044b \u0432 <code>app\/Exceptions\/Handler.php<\/code>, \u043a\u0440\u043e\u043d-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 <code>app\/Console\/Kernel.php<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0446\u0438\u044f \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043a\u044d\u0448\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u0441 <code>CACHE_DRIVER<\/code> \u043d\u0430 <code>CACHE_STORE<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0438 \u043a\u0430\u043a \u043c\u044b \u0441 \u044d\u0442\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c.<\/p>\n<h2>bootstrap\/app.php<\/h2>\n<p>\u0421\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e-\u043f\u0440\u0430\u0432\u0434\u0435, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043c\u044f\u0433\u043a\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0438 \u043d\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.php.net\/manual\/ru\/language.oop5.magic.php#object.invoke\" rel=\"noopener noreferrer nofollow\">invoke<\/a> \u043a\u043b\u0430\u0441\u0441\u044b.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435, \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Console\\Handler as ScheduleHandler; use App\\Exceptions\\Handler as ExceptionHandler; use App\\Http\\Middleware\\Handler as MiddlewareHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withMiddleware(new MiddlewareHandler())     ->withExceptions(new ExceptionHandler())     ->withSchedule(new ScheduleHandler())     ->withCommands([__DIR__ . '\/..\/app\/Console\/Commands'])     ->withRouting(         api: __DIR__ . '\/..\/routes\/api.php',         commands: __DIR__ . '\/..\/routes\/console.php',         apiPrefix: ''     )->create();<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u043a API \u0438 \u0432 \u043d\u0451\u043c \u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u0439 \u043a\u0430\u043a <code>web<\/code>, <code>blade<\/code>, <code>html<\/code>, <code>ts\/js<\/code> \u0438 \u0442.\u043f., \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0438\u0445 \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 <code>api<\/code> \u0443 \u0432\u0441\u0435\u0445 \u0440\u043e\u0443\u0442\u043e\u0432 \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0435\u0433\u043e &#171;\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c&#187;.<\/p>\n<h2>\u041c\u0438\u0434\u043b\u0432\u0430\u0440\u0438<\/h2>\n<p>\u041f\u0440\u0438 \u0447\u0438\u0441\u0442\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Laravel \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>bootstrap\/app.php<\/code>, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/www.php.net\/manual\/ru\/language.oop5.magic.php#object.invoke\" rel=\"noopener noreferrer nofollow\">invoke<\/a> \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace App\\Http\\Middleware;  use App\\Http\\Middleware\\Authorizations\\AuthInternalMiddleware; use App\\Http\\Middleware\\Authorizations\\AuthPrivateMiddleware; use App\\Http\\Middleware\\Authorizations\\AuthPublicMiddleware; use Illuminate\\Foundation\\Configuration\\Middleware as BaseMiddleware;  class Handler {     protected array $aliases = [         'auth.private'  => AuthPrivateMiddleware::class,         'auth.public'   => AuthPublicMiddleware::class,         'auth.internal' => AuthInternalMiddleware::class,     ];      public function __invoke(BaseMiddleware $middleware): BaseMiddleware     {         if ($this->aliases) {             $middleware->alias($this->aliases);         }          return $middleware;     } }<\/code><\/pre>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0430\u043b\u0438\u0430\u0441\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0433\u0440\u0443\u043f\u043f\u0430\u043c\u0438 \u0438 \u0432\u0441\u0435\u043c, \u0447\u0442\u043e \u0443\u043c\u0435\u044e\u0442 &#171;\u043e\u0431\u044b\u0447\u043d\u044b\u0435&#187; \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0438\u0430\u0441\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0441\u0451 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u044f\u043c\u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0444\u0430\u0439\u043b \u0438 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c \u0441 Laravel.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withMiddleware<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Http\\Middleware\\Handler as MiddlewareHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withMiddleware(new MiddlewareHandler())     \/\/ ...     ->create();<\/code><\/pre>\n<h2>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a<\/h2>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0441 \u043c\u0438\u0434\u043b\u0432\u0430\u0440\u044f\u043c\u0438, \u044d\u043a\u0441\u0435\u043f\u0448\u0435\u043d\u044b \u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044c \u0444\u0430\u0439\u043b\u0430 <code>app\/Exceptions\/Handler.php<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u0432\u043e\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0444\u0430\u0439\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace App\\Exceptions;  use Illuminate\\Auth\\AuthenticationException; use Illuminate\\Foundation\\Configuration\\Exceptions as BaseExceptions; use Illuminate\\Http\\Request; use Illuminate\\Support\\Facades\\View; use Sentry\\Laravel\\Integration; use Symfony\\Component\\HttpFoundation\\Response; use Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException; use Throwable;  class Handler {     protected string $jsonFlags = JSON_UNESCAPED_SLASHES ^ JSON_UNESCAPED_UNICODE;      public function __invoke(BaseExceptions $exceptions): BaseExceptions     {         $this->renderUnauthorized($exceptions);         $this->renderNotFound($exceptions);          $this->reportSentry($exceptions);          return $exceptions;     }      protected function renderUnauthorized(BaseExceptions $exceptions): void     {         $exceptions->renderable(             fn (AuthenticationException $e, ?Request $request = null) => $this->response(                 message: __('Unauthorized'),                 code: 401,                 asJson: $request?->expectsJson() ?? false             )         );     }      protected function renderNotFound(BaseExceptions $exceptions): void     {         $exceptions->renderable(             fn (NotFoundHttpException $e, ?Request $request = null) => $this->response(                 message: __('Not Found'),                 code: 404,                 asJson: $request?->expectsJson() ?? false             )         );     }      protected function reportSentry(BaseExceptions $exceptions): void     {         $exceptions->reportable(             fn (Throwable $e) => Integration::captureUnhandledException($e)         );     }      protected function response(string $message, int $code, bool $asJson): Response     {         if ($asJson) {             return response()->json(compact('message'), $code, options: $this->jsonFlags);         }          $this->registerErrorViewPaths();          return response()->view($this->view($code), status: $code);     }      protected function view(int $code): string     {         return view()->exists('errors::' . $code) ? 'errors::' . $code : 'errors::400';     }      protected function registerErrorViewPaths(): void     {         View::replaceNamespace(             'errors',             collect(config('view.paths'))                 ->map(fn (string $path) => \"$path\/errors\")                 ->push($this->vendorViews())                 ->all()         );     }      protected function vendorViews(): string     {         return __DIR__ . '\/..\/..\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Exceptions\/views';     } }<\/code><\/pre>\n<p>\u041f\u0443\u0442\u0438 \u043a <code>view<\/code> \u0444\u0430\u043b\u0430\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#171;404 | \u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e&#187; \u0432\u043c\u0435\u0441\u0442\u043e &#171;404 | Not Found&#187; \u0434\u043b\u044f \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b <code>resources\/views\/errors\/404.blade.php<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"php\">@extends('errors::minimal')  @section('title', __('http-statuses.404')) @section('code',  404) @section('message', __('http-statuses.404'))<\/code><\/pre>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withException<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Exceptions\\Handler as ExceptionHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withExceptions(new ExceptionHandler())     \/\/ ...     ->create();<\/code><\/pre>\n<h2>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e (schedule)<\/h2>\n<p>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0432 Laravel 11 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c &#171;\u043a\u0440\u043e\u043d\u043e\u043c&#187; (cron), \u0441\u0442\u0430\u043b\u0438&#8230; \u0431\u0430\u0440\u0430\u0431\u0430\u043d\u043d\u0430\u044f \u0434\u0440\u043e\u0431\u044c&#8230; \u0420\u041e\u0423\u0422\u0410\u041c\u0418!<\/p>\n<p>\u0414\u0430, \u0412\u044b \u043d\u0435 \u043e\u0441\u043b\u044b\u0448\u0430\u043b\u0438\u0441\u044c. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/laravel.com\/docs\/11.x\/scheduling#introduction\" rel=\"noopener noreferrer nofollow\">\u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c<\/a> \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>routes\/console.php<\/code>.<\/p>\n<p>\u0418 \u043d\u0430\u043c \u0441 \u044d\u0442\u0438\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u043e\u0447\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0444\u0430\u0439\u043b <code>routes\/console.php<\/code> \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0433\u043e \u0446\u0435\u043b\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043b\u0438\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u044f\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0434\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0435 &#171;dev&#187; \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 <code>app\/Console\/Commands<\/code>.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>App\\Console\\Handler<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  namespace App\\Console;  use Illuminate\\Cache\\Console\\PruneStaleTagsCommand; use Illuminate\\Console\\Scheduling\\Schedule;  class Handler {     public function __invoke(Schedule $schedule): void     {         $schedule->command(PruneStaleTagsCommand::class)->hourly();          \/\/ ...     } }<\/code><\/pre>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withSchedule<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use App\\Console\\Handler as ScheduleHandler; use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withSchedule(new ScheduleHandler())     \/\/ ...     ->create();<\/code><\/pre>\n<h2>\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/h2>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>withCommands<\/code> \u0444\u0430\u0439\u043b\u0430 <code>bootstrap\/app.php<\/code>. \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439 \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 <code>app\/Console<\/code>:<\/p>\n<pre><code class=\"php\">&lt;?php  use Illuminate\\Foundation\\Application;  return Application::configure(basePath: dirname(__DIR__))     ->withCommands([__DIR__ . '\/..\/app\/Console\/Commands'])     \/\/ ...     ->create(); <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u041f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u0438 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <code>php artisan &lt;name><\/code>.<\/p>\n<h2>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Laravel \u0442\u0430\u043a\u0436\u0435 \u043b\u0438\u0448\u0438\u043b\u0430\u0441\u044c \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 <code>RouteServiceProvider<\/code> \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u043f\u0430\u043f\u043a\u0438 <code>routes<\/code>. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 <code>web<\/code> \u0437\u043e\u043d\u044b, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b <code>routes\/api.php<\/code>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432 \u0433\u0440\u0443\u043f\u043f:<\/p>\n<pre><code class=\"php\">&lt;?php  app('router')     ->middleware('auth.private')     ->name('private.')     ->prefix('v1\/private')     ->group(__DIR__ . '\/api\/private.php');  app('router')     ->middleware('auth.public')     ->name('public.')     ->prefix('v1\/public')     ->group(__DIR__ . '\/api\/public.php');  app('router')     ->middleware('auth.internal')     ->name('internal.')     ->prefix('v1\/internal')     ->group(__DIR__ . '\/api\/internal.php');<\/code><\/pre>\n<h2>\u0421\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b<\/h2>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0431\u044b\u043b\u043e \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0444\u0430\u0439\u043b <code>bootstrap\/providers.php<\/code>, \u0441\u0442\u0430\u0440\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0451 \u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 <code>array_merge<\/code>.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0443\u044e <code>fallback<\/code> \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e Laravel \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 <code>json<\/code> \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 \u043d\u0435\u0451. \u0422\u043e \u0435\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 <code>__('Whoo<\/code><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-379757","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/379757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=379757"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/379757\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}