{"id":1048,"date":"2019-01-18T18:27:02","date_gmt":"2019-01-18T09:27:02","guid":{"rendered":"https:\/\/qol-kk.com\/wp2\/?p=1048"},"modified":"2019-01-18T18:27:02","modified_gmt":"2019-01-18T09:27:02","slug":"post-1048","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2019\/01\/18\/post-1048\/","title":{"rendered":"Laravel\uff1a\u7ba1\u7406\u8005\u306b\u3088\u308bregister\u5b9f\u884c\u5f8c\u306e\u52d5\u4f5c\u3092\u5909\u3048\u308b"},"content":{"rendered":"<h2>Laravel\uff1aregister\u5b9f\u884c\u5f8c\u306e\u52d5\u4f5c\u3092\u5909\u3048\u308b<\/h2>\n<p>\u524d\u306e\u8a18\u4e8b\u3067\u306f\u300e<a href=\"https:\/\/qol-kk.com\/wp2\/blog\/2019\/01\/18\/post-1045\/\">\u7ba1\u7406\u8005\u306b\u3088\u308b\u30e6\u30fc\u30b6\u30fc\u767b\u9332\uff0fguest\u306e\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u4e0d\u53ef<\/a>\u300f\u306e\u5b9f\u88c5\u306b\u3064\u3044\u3066\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u524d\u56de\u307e\u3067\u306e\u72b6\u614b\u3067\u3059\u3068\u5acc\u306a\u52d5\u304d\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"borderBox\">\u7ba1\u7406\u8005\u3067\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u3063\u305f\u5f8c\u3001\u4f5c\u6210\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\u3057Home\u3092\u958b\u304f\u3002<\/div>\n<p>\u4f8b\u3048\u3070\u3001Admin\u3068\u3044\u3046\u7ba1\u7406\u8005\u3067TEST\u3068\u3044\u3046\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u3063\u305f\u5834\u5408\u3001\u65b0\u898f\u767b\u9332\u5f8c\u306fTEST\u3067Home\u3078redirect\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u30ed\u30b0\u30a4\u30f3\u30c6\u30b9\u30c8\u304c\u51fa\u6765\u308b\u3068\u8a00\u3048\u3070\u805e\u3053\u3048\u306f\u3044\u3044\u3067\u3059\u304c\u3001\u6c17\u6301\u3061\u3044\u3044\u52d5\u4f5c\u3067\u306f\u306a\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3092\u3057\u305f\u3089Admin\u306e\u307e\u307eHome\u3078\u79fb\u52d5\u3059\u308b\u69d8\u306b\u4f5c\u308a\u5909\u3048\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>RegistersUsers.php\u3092\u5909\u66f4<\/h3>\n<p>\u3010vendeor\\laravel\\framework\\src\\Illuminate\\Foundation\\Auth\\RegistersUsers.php\u3011<br \/>\n\u3053\u308c\u3092\u5f04\u308a\u307e\u3059\u3002<\/p>\n<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067\u30eb\u30fc\u30bf\u30fc\u306b\u8a18\u8f09\u3057\u305f\u30ec\u30b8\u30b9\u30bf\u30fc\u304c\u898b\u3066\u3044\u308b\u5148\u304c\u3053\u3053\u3067\u3059\u3002create\u3068\u305d\u306e\u5f8c\u306e\u52d5\u4f5c\u306f \u300epublic function register\u300f\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">    public function register(Request $request)\r\n    {\r\n        $this-&gt;validator($request-&gt;all())-&gt;validate();\r\n\r\n        event(new Registered($user = $this-&gt;create($request-&gt;all())));\r\n\r\n        $this-&gt;guard()-&gt;login($user);\r\n\r\n        return $this-&gt;registered($request, $user)\r\n                        ?: redirect($this-&gt;redirectPath());\r\n    }<\/pre>\n<p>\u89e3\u8aac\u3059\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<ol>\n<li>$this-&gt;validator($request-&gt;all())-&gt;validate();<br \/>\n\u203b\u30d0\u30ea\u30c7\u30fc\u30bf<\/li>\n<li>event(new Registered($user = $this-&gt;create($request-&gt;all())));<br \/>\n\u203b\u30af\u30ea\u30a8\u30a4\u30c8<\/li>\n<li>$this-&gt;guard()-&gt;login($user);<br \/>\n\u203b\u30af\u30ea\u30a8\u30a4\u30c8\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u3067\u306e\u30ed\u30b0\u30a4\u30f3<\/li>\n<li>return $this-&gt;registered($request, $user) ?: redirect($this-&gt;redirectPath());<br \/>\n\u203b\u30ed\u30b0\u30a4\u30f3\u5f8cTOP\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8<\/li>\n<\/ol>\n<p>\u4eca\u56de\u306f\u300e\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u306a\u3044\u300f\u300e\u30ed\u30b0\u30a4\u30f3\u5f8cTOP\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u300f\u306a\u306e\u3067\u90aa\u9b54\u8005\u306f\u9805\u76ee3\u3002<br \/>\n\u3053\u3044\u3064\u3092\u3054\u3063\u305d\u308a\u524a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">    public function register(Request $request)\r\n    {\r\n        $this-&gt;validator($request-&gt;all())-&gt;validate();\r\n\r\n        event(new Registered($user = $this-&gt;create($request-&gt;all())));\r\n\r\n\/\/$this-&gt;guard()-&gt;login($user);\r\n\r\n        return $this-&gt;registered($request, $user)\r\n                        ?: redirect($this-&gt;redirectPath());\r\n    }<\/pre>\n<p>\u4e0a\u624b\u304f\u3044\u304d\u307e\u3057\u305f\uff1f<\/p>\n<p>\u3053\u308c\u3067\u3082\u4e0a\u624b\u304f\u3044\u304b\u306a\u3044\u5834\u5408\u306f\u9805\u76ee4\u3092 [ return redirect('\/home'); ] \u3068\u5165\u308c\u66ff\u3048\u307e\u3059\u3002<br \/>\n\u4f55\u3082\u8003\u3048\u305a\u306bhome\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3057\u308d\uff01\u3068\u3044\u3046\u95a2\u6570\u3067\u3059\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u3053\u3092 [ return view('\/home'); ] \u3068\u3059\u308b\u3068\u30a2\u30c9\u30ec\u30b9\u304c \/register \u306e\u307e\u307e\/home\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\nredirect\u3057\u306a\u304f\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>\u305a\u3063\u3068\u8a8d\u8a3c\u7cfb\u306e\u30c8\u30ec\u30a4\u30c8\u3092\u8ffd\u3063\u3066\u3044\u305f\u304b\u3089\u304b\u3001\u3068\u3066\u3082\u30b9\u30e0\u30fc\u30ba\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b8b\u308b\u306f\u30e6\u30fc\u30b6\u4e00\u89a7\u3068\u7ba1\u7406\u8005\u306b\u3088\u308b\u5909\u66f4\u6a5f\u80fd\u3002<\/p>\n<p>\u9811\u5f35\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\uff1aregister\u5b9f\u884c\u5f8c\u306e\u52d5\u4f5c\u3092\u5909\u3048\u308b \u524d\u306e\u8a18\u4e8b\u3067\u306f\u300e\u7ba1\u7406\u8005\u306b\u3088\u308b\u30e6\u30fc\u30b6\u30fc\u767b\u9332\uff0fguest\u306e\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u4e0d\u53ef\u300f\u306e\u5b9f\u88c5\u306b\u3064\u3044\u3066\u66f8\u304d\u307e\u3057\u305f\u3002 \u524d\u56de\u307e\u3067\u306e\u72b6\u614b\u3067\u3059\u3068\u5acc\u306a\u52d5\u304d\u304c\u3042\u308a\u307e\u3059\u3002 \u7ba1\u7406\u8005\u3067\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u3063 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":944,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"vkexunit_cta_each_option":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34],"tags":[278,281,153,98,282,53,49,283,284],"class_list":["post-1048","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-memorandum","tag-auth","tag-guard","tag-laravel","tag-php","tag-register","tag-53","tag-49","tag-283","tag-284"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2018\/11\/laravel_logo.png","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/1048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=1048"}],"version-history":[{"count":0,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/1048\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/944"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=1048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=1048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}