{"id":459,"date":"2024-07-04T19:13:01","date_gmt":"2024-07-04T10:13:01","guid":{"rendered":"https:\/\/software.satoshis.jp\/?p=459"},"modified":"2025-10-12T18:05:16","modified_gmt":"2025-10-12T09:05:16","slug":"laravel-11-%e3%81%a7-providers-%e3%81%a8-aliases-%e3%81%ae%e8%a8%ad%e5%ae%9a%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/software.satoshis.jp\/?p=459","title":{"rendered":"Laravel 11 \u3084 12 \u3067 providers \u3068 aliases \u306e\u8a2d\u5b9a\u65b9\u6cd5"},"content":{"rendered":"<p>Laravel 11 \u3067\u306f\u3001config\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u304b\u306a\u308a\u6574\u7406\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u307e\u3067\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001config\/app.php \u306b providers \u3068 aliases \u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001Laravel 11 \u3067\u306f\u3001\u8a18\u8ff0\u3059\u308b\u5834\u6240\u304c\u5909\u308f\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>providers \u306b\u3064\u3044\u3066\u306f\u3001bootstrap\/providers.php \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>Laravel 12 \u3067\u3082\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u914d\u7f6e\u306f\u7dad\u6301\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nreturn &#x5B;\r\n    App\\Providers\\AppServiceProvider::class,\r\n    App\\Providers\\AuthServiceProvider::class,\r\n    \/\/ \u3053\u3053\u306b\u8ffd\u52a0\r\n];\r\n<\/pre>\n<p>aliases \u306f\u3001bootstrap\/app.php \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Foundation\\Application;\r\nuse Illuminate\\Foundation\\Configuration\\Exceptions;\r\nuse Illuminate\\Foundation\\Configuration\\Middleware;\r\n\r\nreturn Application::configure(basePath: dirname(__DIR__))\r\n    -&gt;withRouting(\r\n        web: __DIR__.&#039;\/..\/routes\/web.php&#039;,\r\n        commands: __DIR__.&#039;\/..\/routes\/console.php&#039;,\r\n        health: &#039;\/up&#039;,\r\n    )\r\n    -&gt;withMiddleware(function (Middleware $middleware) {\r\n        \/\/\r\n    })\r\n    -&gt;withExceptions(function (Exceptions $exceptions) {\r\n        \/\/\r\n    })-&gt;create();\r\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Foundation\\Application;\r\nuse Illuminate\\Foundation\\Configuration\\Exceptions;\r\nuse Illuminate\\Foundation\\Configuration\\Middleware;\r\n\r\nreturn Application::configure(basePath: dirname(__DIR__))\r\n    -&gt;withRouting(\r\n        web: __DIR__.&#039;\/..\/routes\/web.php&#039;,\r\n        commands: __DIR__.&#039;\/..\/routes\/console.php&#039;,\r\n        health: &#039;\/up&#039;,\r\n    )\r\n    -&gt;withMiddleware(function (Middleware $middleware) {\r\n        $middleware-&gt;alias(&#x5B;\r\n            &#039;Hoge&#039; =&gt; Hoge::class,\r\n        ]);\r\n    })\r\n    -&gt;withExceptions(function (Exceptions $exceptions) {\r\n        \/\/\r\n    })-&gt;create();\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Laravel 11 \u3067\u306f\u3001config\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u304b\u306a\u308a\u6574\u7406\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002 \u3053\u308c\u307e\u3067\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u3001config\/app.php \u306b providers \u3068 aliases \u3092\u8a18\u8ff0 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":63,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[168,14,167],"class_list":["post-459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-aliases","tag-laravel","tag-providers"],"nelio_content":{"autoShareEndMode":"never","automationSources":{"useCustomSentences":false,"customSentences":[]},"efiAlt":"","efiUrl":"","followers":[1],"highlights":[],"isAutoShareEnabled":true,"networkImageIds":[],"permalinkQueryArgs":[],"series":[],"suggestedReferences":[]},"views":8089,"_links":{"self":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=459"}],"version-history":[{"count":3,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/459\/revisions"}],"predecessor-version":[{"id":508,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/459\/revisions\/508"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/media\/63"}],"wp:attachment":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}