{"id":11553,"date":"2023-03-18T11:27:51","date_gmt":"2023-03-18T02:27:51","guid":{"rendered":"https:\/\/www.stuffy.site\/computers\/?p=11553"},"modified":"2023-03-18T16:22:20","modified_gmt":"2023-03-18T07:22:20","slug":"laravelrocky-linux-%e3%83%ad%e3%82%b0%e3%82%a2%e3%82%a6%e3%83%88%e6%a9%9f%e8%83%bd%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.stuffy.site\/computers\/archives\/11553","title":{"rendered":"Laravel@Rocky Linux \u30ed\u30b0\u30a2\u30a6\u30c8\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u308b"},"content":{"rendered":"\n<p>Laravel ui vue -auth \u3067\u306f\u672a\u5b9f\u88c5\u306e\u30ed\u30b0\u30a2\u30a6\u30c8\u6a5f\u80fd\u3092\u65e2\u5b58\u306ehome.blade.php\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u7c21\u5358\u306a\u3082\u306e\u3067\u3059\u304c\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u4eca\u56de\u4f7f\u7528\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f<\/p>\n\n\n\n<p>welcome.blade.php<br>home.blade.php<br>web.php<br>ExceptionHandler.php \u3067\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305awelcome.blade.php home.blade.php \u3092\u30b3\u30d4\u30fc\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u3063\u3066\u304b\u3089 welcome.blade.php \u306e BODY\u90e8\u5206\u306e\u4e0d\u8981\u306a\u8981\u7d20\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre><span style=\"font-size: 14pt; color: #0000ff;\">$ cp .\/resources\/views\/welcome.blade.php{,.org}<br>$ cp .\/resources\/views\/home.blade.php{,.org}<br><br>$ vi .\/resources\/views\/welcome.blade.php<\/span><\/pre>\n\n\n<p>\u6b21\u306bhome.blade.php \u306e\u30ed\u30b0\u30a4\u30f3\u30c1\u30a7\u30c3\u30af\u90e8\u5206\u306b\u30ed\u30b0\u30a2\u30a6\u30c8\u30d5\u30a9\u30fc\u30e0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u30eb\u30c3\u30af\u30d5\u30a3\u30fc\u30eb\u3092\u30c6\u30ad\u30b9\u30c8\u8868\u793a\u306b\u305d\u308d\u3048\u308b\u305f\u3081\u30ea\u30f3\u30af\u3092 a\u30bf\u30b0\u304b\u3089GET\u3067\u9001\u4fe1\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n<pre><span style=\"font-size: 14pt; color: #0000ff;\">$ vi .\/resources\/views\/home.blade.php<br><\/span><br>\n   {{ __('You are logged in!') }}&lt;br&gt;<br>  &lt;div&gt;\n    &lt;a href=\"#\" onclick=\"event.preventDefault(); document.getElementById('logout-form').submit();\"&gt;Logout&lt;\/a&gt;\n    &lt;form id=\"logout-form\" action=\"{{ route('logout') }}\" method=\"POST\" style=\"display: none;\"&gt;\n      @csrf\n    &lt;\/form&gt;\n  &lt;\/div&gt;<\/pre>\n\n\n<p>\u7d9a\u3044\u3066 web.php \u306b &#8216;logout&#8217;  \u30ea\u30f3\u30af\u3092GET\u9001\u4fe1\u3057\u305f\u3068\u304d\u306e\u30eb\u30fc\u30c8\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre><span style=\"font-size: 14pt; color: #0000ff;\">$ vi .\/routes\/web.php<br><\/span>\nRoute::get('\/', function () {\n    return view('welcome');\n});\n\nAuth::routes();\n\nRoute::get('\/home', [App\\Http\\Controllers\\HomeController::class, 'index'])-&gt;name('home');\n\n<span style=\"color: #0000ff;\">Route::get('logout', 'Auth\\LoginController@logout')-&gt;name('logout'); \u2190 \uff08\u8ffd\u8a18<\/span><\/pre>\n\n\n<p>\u6700\u5f8c\u306bHandler.php \u306b\u4f8b\u5916\u6642\u306b\u5f37\u5236\u30ed\u30b0\u30a2\u30a6\u30c8\u3059\u308b\u30b3\u30fc\u30c9\u3092\u8ffd\u8a18\u3059\u308b\u3068\u826f\u3044\u611f\u3058\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n<pre><span style=\"font-size: 14pt; color: #0000ff;\">$ vi .\/app\/Exceptions\/Handler.php<br><\/span>\n    \/**\n     * Register the exception handling callbacks for the application.\n     *\/\n    public function register(): void\n    {\n        $this-&gt;reportable(function (Throwable $e) {\n            \/\/\n        });\n    }<br><span style=\"color: #0000ff;\">\/* \u2193\u2193\u2193\u2193\uff08\u4ee5\u4e0b\u8ffd\u8a18\uff09\u2193\u2193\u2193\u2193 *\/<\/span>\n    public function render($request, Throwable $exception)\n    {\n\n        if($exception instanceof TokenMismatchException) {\n            \/\/ \u30ed\u30b0\u30a2\u30a6\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u6642\u306f\u3001\u5f37\u5236\u7684\u306b\u30ed\u30b0\u30a2\u30a6\u30c8\n            if($request-&gt;is('logout')) {\n               return redirect('login');\n            }\n        }\n\n        return parent::render($request, $exception);\n    }\n<span style=\"color: #0000ff;\">\/* \u2191\u2191\u2191\u2191\u2191\uff08\u8ffd\u8a18\u3053\u3053\u307e\u3067\uff09\u2191\u2191\u2191\u2191\u2191\u2191 *\/<\/span>\n}<\/pre>\n\n\n<p class=\"has-text-align-right\">.<\/p>\n\n\n\n<p>\u30ed\u30b0\u30a2\u30a6\u30c8\u30a2\u30f3\u30ab\u30fc\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/logout.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/logout.png\" alt=\"\" class=\"wp-image-11560\" width=\"633\" height=\"306\" srcset=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/logout.png 844w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/logout-300x145.png 300w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/logout-768x371.png 768w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-right\">.<\/p>\n\n\n\n<p>welcome.blade.php \u30c8\u30c3\u30d7\u306b\u623b\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/welcome_blade.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/welcome_blade.png\" alt=\"\" class=\"wp-image-11562\" width=\"644\" height=\"519\" srcset=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/welcome_blade.png 859w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/welcome_blade-300x242.png 300w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/welcome_blade-768x619.png 768w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-right\">.<\/p>\n\n\n\n<p>\u53c2\u8003URL: <a href=\"https:\/\/tech.notti.link\/6e8a13d\">[Laravel] \u30ed\u30b0\u30a2\u30a6\u30c8\u30ea\u30f3\u30af\u3092\u4f5c\u308b<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/blog.lesimo.jp\/archives\/186\">Laravel \u30ed\u30b0\u30a2\u30a6\u30c8\u3067\u304d\u306a\u3044\u554f\u984c<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/taustation.com\/laravel-logout\/\">Laravel \u2013 \u30ed\u30b0\u30a2\u30a6\u30c8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/pgmemo.tokyo\/data\/archives\/1483.html\">Laravel \u306e Auth \u3067 \u30ed\u30b0\u30a4\u30f3\u5f8c \/ \u30ed\u30b0\u30a2\u30a6\u30c8\u5f8c \/ \u30ed\u30b0\u30a4\u30f3\u6e08 \u306e\u9077\u79fb\u5148\u3092\u5909\u66f4\u3059\u308b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel ui vue -auth \u3067\u306f\u672a\u5b9f\u88c5\u306e\u30ed\u30b0\u30a2\u30a6\u30c8\u6a5f\u80fd\u3092\u65e2\u5b58\u306ehome.blade.php\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u7c21\u5358\u306a\u3082\u306e\u3067\u3059\u304c\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101,91],"tags":[],"class_list":["post-11553","post","type-post","status-publish","format-standard","hentry","category-laravel","category-rocky-linux"],"_links":{"self":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/11553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/comments?post=11553"}],"version-history":[{"count":12,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/11553\/revisions"}],"predecessor-version":[{"id":11568,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/11553\/revisions\/11568"}],"wp:attachment":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/media?parent=11553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/categories?post=11553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/tags?post=11553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}