{"id":7969,"date":"2020-09-17T20:39:19","date_gmt":"2020-09-17T11:39:19","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=7969"},"modified":"2020-09-17T20:40:20","modified_gmt":"2020-09-17T11:40:20","slug":"laravel-jetstream%e3%81%aeemail-verification%ef%bc%88%e8%aa%8d%e8%a8%bc%e3%83%a1%e3%83%bc%e3%83%ab%ef%bc%89%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=7969","title":{"rendered":"Laravel Jetstream\u306eEmail Verification\uff08\u8a8d\u8a3c\u30e1\u30fc\u30eb\uff09\u306e\u4f7f\u3044\u65b9"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308d<code>Laravel 8.x<\/code>\u306e\u76ee\u7389\u6a5f\u80fd\u300c<strong>Jetstream<\/strong>\u300d\u306e\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u4eca\u56de\u306f\u3001\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=7930\">Laravel Jetstream \u306e\u5404\u7a2e\u30d5\u30a9\u30fc\u30e0\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b<\/a>\u300d\u306e\u300c\u304a\u308f\u308a\u306b\u300d\u3067\u89e6\u308c\u305f\u8a71\u984c\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">Email Verification\uff08\u8a8d\u8a3c\u30e1\u30fc\u30eb\uff09<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u8ab0\u3067\u3082\u767b\u9332\u3067\u304d\u308b\u30bf\u30a4\u30d7\u306e\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u306e\u5834\u5408\u306b\u554f\u984c\u306b\u306a\u308b\u300c<strong>\u767b\u9332\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u672c\u5f53\u306b\u6b63\u3057\u3044\u306e\u304b\uff1f\uff1f<\/strong>\u300d\u3068\u3044\u3046\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u5b9f\u969b\u306b\u767b\u9332\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u300c\u8a8d\u8a3c\u30e1\u30fc\u30eb\u300d\u3092\u9001\u308a\u3001\u305d\u3053\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3082\u3089\u3046\u3053\u3068\u3067\u6b63\u3057\u3044\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u203b\u3053\u308c\u3092\u3084\u3063\u3066\u304a\u304b\u306a\u3044\u3068\u3001\u3082\u3057\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u308f\u304b\u3089\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u518d\u767a\u884c\u30da\u30fc\u30b8\u3067\u767b\u9332\u3057\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u9001\u4fe1\u3057\u3066\u3082\u9593\u9055\u3063\u305f\u3068\u3053\u308d\u306b\u5c4a\u304f\u306e\u3067\u3001\u4e8c\u5ea6\u3068\u81ea\u5206\u3067\u306f\u5fa9\u6d3b\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u3053\u306e<code>Email Verification<\/code>\u3092\u4f7f\u3046\u65b9\u6cd5\u3068\u3001\u524d\u56de\u306b\u5f15\u304d\u7d9a\u304d\u65e5\u672c\u8a9e\u5316\u3059\u308b\u65b9\u6cd5\u3082\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<br \/>\n\uff08\u6700\u5f8c\u306b\u3001\u65e5\u672c\u8a9e\u5316\u7528\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3088\ud83d\udc4d\uff09<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2173 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png\" alt=\"\" width=\"300\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24-281x300.png 281w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u9593\u9055\u3063\u3066\u3044\u308b\u3068\u3001<br \/>\n\u904b\u55b6\u5074\u304b\u3089\u3057\u3066\u3082\u3081\u3093\u3069\u3046\u3067\u3059\ud83d\ude2d\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p>\u3082\u3061\u308d\u3093<code>Laravel Jetstream<\/code>\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<br \/>\n\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\ud83d\udcdd\u00a0<a href=\"https:\/\/blog.capilano-fw.com\/?p=7827\">Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<h1>Email Verification\u3092\u6709\u52b9\u306b\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001<code>Email Verification<\/code>\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u3067\u3059\u3002<\/p>\n<p><strong>config\/fortify.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nuse App\\Providers\\RouteServiceProvider;\r\nuse Laravel\\Fortify\\Features;\r\n\r\nreturn [\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n    'features' =&gt; [\r\n        Features::registration(),\r\n        Features::resetPasswords(),\r\n        <strong>Features::emailVerification(),<\/strong> \/\/ \ud83d\udc48 \u3053\u3053\u306e\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u9664\u53bb\r\n        Features::updateProfileInformation(),\r\n        Features::updatePasswords(),\r\n        Features::twoFactorAuthentication(),\r\n    ],\r\n\r\n];<\/pre>\n<p>\u305d\u3057\u3066\u3001<code>User<\/code>\u30e2\u30c7\u30eb\u306e\u4e2d\u8eab\u3082\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse App\\Events\\UserCreated;\r\n<strong>use Illuminate\\Contracts\\Auth\\MustVerifyEmail;<\/strong> \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\r\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\r\nuse Illuminate\\Notifications\\Notifiable;\r\nuse Laravel\\Fortify\\TwoFactorAuthenticatable;\r\nuse Laravel\\Jetstream\\HasProfilePhoto;\r\nuse Laravel\\Jetstream\\HasTeams;\r\nuse Laravel\\Sanctum\\HasApiTokens;\r\n\r\nclass User extends Authenticatable <strong>implements MustVerifyEmail <\/strong>\/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\n{\r\n    \/\/ \u7701\u7565<\/pre>\n<p>\u3053\u308c\u3067<code>Email Verification<\/code>\u81ea\u4f53\u306f\u6709\u52b9\u306b\u306a\u308a\u307e\u3057\u305f\uff01<\/p>\n<h1>\u65e5\u672c\u8a9e\u5316\u3059\u308b<\/h1>\n<p>\u3053\u3053\u307e\u3067\u306e\u4f5c\u696d\u3060\u3051\u3067<code>Email Verification<\/code>\u81ea\u4f53\u306f\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u8a8d\u8a3c\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u30d5\u30a9\u30fc\u30e0\u3084\u9001\u4fe1\u3055\u308c\u308b\u8a8d\u8a3c\u30e1\u30fc\u30eb\u306f\u5168\u3066\u82f1\u8a9e\u3067\u66f8\u304b\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u3053\u3053\u304b\u3089\u306f\u65e5\u672c\u8a9e\u5316\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30d3\u30e5\u30fc\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b<\/h2>\n<p>\u307e\u305a\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3057\u305f\u6642\u306b\u8868\u793a\u3055\u308c\u308b\u30c6\u30ad\u30b9\u30c8\u3092\u65e5\u672c\u8a9e\u5316\u3057\u307e\u3059\u3002\uff08<strong>\u592a\u5b57<\/strong>\u304c\u5909\u66f4\u3057\u305f\u90e8\u5206\u3067\u3059\uff09<\/p>\n<p><strong>resources\/views\/auth\/verify-email.blade.php<\/strong><\/p>\n<pre>&lt;x-guest-layout&gt;\r\n    &lt;x-jet-authentication-card&gt;\r\n        &lt;x-slot name=\"logo\"&gt;\r\n            &lt;x-jet-authentication-card-logo \/&gt;\r\n        &lt;\/x-slot&gt;\r\n\r\n        &lt;div class=\"mb-4 text-sm text-gray-600\"&gt;\r\n            <strong>\u3054\u767b\u9332\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01&lt;br&gt;<\/strong>\r\n<strong>            \u3054\u5165\u529b\u3044\u305f\u3060\u3044\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3078\u8a8d\u8a3c\u30ea\u30f3\u30af\u3092\u9001\u4fe1\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u30af\u30ea\u30c3\u30af\u3057\u3066\u8a8d\u8a3c\u3092\u5b8c\u4e86\u3055\u305b\u3066\u304f\u3060\u3055\u3044\u3002&lt;br&gt;<\/strong>\r\n<strong>            \u3082\u3057\u3001\u8a8d\u8a3c\u30e1\u30fc\u30eb\u304c\u5c4a\u304b\u306a\u3044\u5834\u5408\u306f\u518d\u9001\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002<\/strong>\r\n        &lt;\/div&gt;\r\n\r\n        @if (session('status') == 'verification-link-sent')\r\n            &lt;div class=\"mb-4 font-medium text-sm text-green-600\"&gt;\r\n                <strong>\u65b0\u3057\u3044\u8a8d\u8a3c\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u307e\u3057\u305f\u3002<\/strong>\r\n            &lt;\/div&gt;\r\n        @endif\r\n\r\n        &lt;div class=\"mt-4 flex items-center justify-between\"&gt;\r\n            &lt;form method=\"POST\" action=\"\/email\/verification-notification\"&gt;\r\n                @csrf\r\n\r\n                &lt;div&gt;\r\n                    &lt;x-jet-button type=\"submit\"&gt;\r\n                        <strong>\u8a8d\u8a3c\u30e1\u30fc\u30eb\u3092\u518d\u9001\u3059\u308b<\/strong>\r\n                    &lt;\/x-jet-button&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/form&gt;\r\n\r\n            &lt;form method=\"POST\" action=\"\/logout\"&gt;\r\n                @csrf\r\n\r\n                &lt;button type=\"submit\" class=\"underline text-sm text-gray-600 hover:text-gray-900\"&gt;\r\n                    <strong>\u30ed\u30b0\u30a2\u30a6\u30c8<\/strong>\r\n                &lt;\/button&gt;\r\n            &lt;\/form&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/x-jet-authentication-card&gt;\r\n&lt;\/x-guest-layout&gt;<\/pre>\n<h2>\u8a8d\u8a3c\u30e1\u30fc\u30eb\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b<\/h2>\n<p>\u8a8d\u8a3c\u30e1\u30fc\u30eb\u3092\u65e5\u672c\u8a9e\u5316\u3059\u308b\u306b\u306f\u3001\u5c02\u7528\u306e<code>Notification<\/code>\u3092\u3064\u304f\u3063\u3066\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:notification VerifyEmailJapanese<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>app\/Notifications\/VerifyEmailJapanese.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Notifications;\r\n\r\nuse Illuminate\\Bus\\Queueable;\r\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\r\nuse Illuminate\\Notifications\\Messages\\MailMessage;\r\nuse Illuminate\\Notifications\\Notification;\r\nuse Illuminate\\Support\\Carbon;\r\nuse Illuminate\\Support\\Facades\\Config;\r\nuse Illuminate\\Support\\Facades\\Lang;\r\nuse Illuminate\\Support\\Facades\\URL;\r\n\r\nclass VerifyEmailJapanese extends Notification\r\n{\r\n    \/**\r\n     * The callback that should be used to build the mail message.\r\n     *\r\n     * @var \\Closure|null\r\n     *\/\r\n    public static $toMailCallback;\r\n\r\n    \/**\r\n     * Get the notification's channels.\r\n     *\r\n     * @param  mixed  $notifiable\r\n     * @return array|string\r\n     *\/\r\n    public function via($notifiable)\r\n    {\r\n        return ['mail'];\r\n    }\r\n\r\n    \/**\r\n     * Build the mail representation of the notification.\r\n     *\r\n     * @param  mixed  $notifiable\r\n     * @return \\Illuminate\\Notifications\\Messages\\MailMessage\r\n     *\/\r\n    public function toMail($notifiable)\r\n    {\r\n        <strong>$verificationUrl = $this-&gt;verificationUrl($notifiable);<\/strong>\r\n\r\n<strong>        if (static::$toMailCallback) {<\/strong>\r\n<strong>            return call_user_func(static::$toMailCallback, $notifiable, $verificationUrl);<\/strong>\r\n<strong>        }<\/strong>\r\n\r\n<strong>        return (new MailMessage)<\/strong>\r\n<strong>            -&gt;subject(Lang::get('\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a8d\u8a3c\u3057\u3066\u304f\u3060\u3055\u3044'))<\/strong>\r\n<strong>            -&gt;line(Lang::get('\u4ee5\u4e0b\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u8a8d\u8a3c\u3057\u3066\u304f\u3060\u3055\u3044'))<\/strong>\r\n<strong>            -&gt;action(Lang::get('\u8a8d\u8a3c\u3059\u308b'), $verificationUrl)<\/strong>\r\n<strong>            -&gt;line(Lang::get('\uff08\u3082\u3057\u3053\u306e\u30e1\u30fc\u30eb\u306b\u899a\u3048\u304c\u306a\u3044\u5834\u5408\u306f\u653e\u7f6e\u3057\u3066\u554f\u984c\u3054\u3056\u3044\u307e\u305b\u3093\uff09'));<\/strong>\r\n    }\r\n\r\n    \/**\r\n     * Get the verification URL for the given notifiable.\r\n     *\r\n     * @param  mixed  $notifiable\r\n     * @return string\r\n     *\/\r\n    protected function verificationUrl($notifiable)\r\n    {\r\n        <strong>return URL::temporarySignedRoute(<\/strong>\r\n<strong>            'verification.verify',<\/strong>\r\n<strong>            Carbon::now()-&gt;addMinutes(Config::get('auth.verification.expire', 60)),<\/strong>\r\n<strong>            [<\/strong>\r\n<strong>                'id' =&gt; $notifiable-&gt;getKey(),<\/strong>\r\n<strong>                'hash' =&gt; sha1($notifiable-&gt;getEmailForVerification()),<\/strong>\r\n<strong>            ]<\/strong>\r\n<strong>        );<\/strong>\r\n    }\r\n\r\n    \/**\r\n     * Set a callback that should be used when building the notification mail message.\r\n     *\r\n     * @param  \\Closure  $callback\r\n     * @return void\r\n     *\/\r\n    public static function toMailUsing($callback)\r\n    {\r\n        static::$toMailCallback = $callback;\r\n    }\r\n}<\/pre>\n<p><code>Notification<\/code>\u3092\u4f5c\u6210\u3057\u305f\u3089\u3001\u6b21\u306f<code>User<\/code>\u30e2\u30c7\u30eb\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/User.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\nclass User extends Authenticatable implements MustVerifyEmail\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    \/\/ \ud83d\udc47 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\n    <strong>public function sendEmailVerificationNotification()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;notify(new \\App\\Notifications\\VerifyEmailJapanese);<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u305f\u3060\u3057\u3001\u5b9f\u306f\u3053\u308c\u3060\u3051\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4e2d\u9014\u534a\u7aef\u306a\u65e5\u672c\u8a9e\u5316\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7971\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_3.png\" alt=\"\" width=\"549\" height=\"273\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_3.png 549w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_3-300x149.png 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/p>\n<p>\u3053\u308c\u306f<code>Email Verification<\/code>\u306e\u554f\u984c\u3067\u306f\u306a\u304f\u3001<code>Notification<\/code>\u672c\u4f53\u3067\u306e\u8a2d\u5b9a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089\u3053\u306e\u90e8\u5206\u306e\u30d3\u30e5\u30fc\u3092<code>Laravel<\/code>\u672c\u4f53\u3078\u30b3\u30d4\u30fc\u3057\u3066\u65e5\u672c\u8a9e\u5316\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan vendor:publish<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30b3\u30d4\u30fc\u3067\u304d\u308b\u30ea\u30b9\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u300c<strong>laravel-notifications<\/strong>\u300d\u3068\u66f8\u304b\u308c\u3066\u3044\u308b\u756a\u53f7\u3092\u5165\u529b\u3057\u3066<code>Enter<\/code>\u30ad\u30fc\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\uff08\u756a\u53f7\u306f\u74b0\u5883\u306b\u3088\u3063\u3066\u9055\u3046\u3068\u601d\u3044\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7972\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_4.png\" alt=\"\" width=\"422\" height=\"471\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_4.png 422w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_4-269x300.png 269w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/p>\n<p>\u3053\u308c\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\u304c\u5b8c\u4e86\u3057\u305f\u306e\u3067\u5b9f\u969b\u306b\u65e5\u672c\u8a9e\u5316\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\uff08<strong>\u592a\u5b57<\/strong>\u304c\u5909\u66f4\u3057\u305f\u90e8\u5206\u3067\u3059\uff09<\/p>\n<p><strong>resources\/views\/vendor\/notifications\/email.blade.php<\/strong><\/p>\n<pre>@component('mail::message')\r\n{{-- Greeting --}}\r\n@if (! empty($greeting))\r\n# {{ $greeting }}\r\n@else\r\n@if ($level === 'error')\r\n# @lang('<strong>\u30a8\u30e9\u30fc\u767a\u751f<\/strong>')\r\n@else\r\n# @lang('<strong>\u3053\u3093\u306b\u3061\u306f!<\/strong>')\r\n@endif\r\n@endif\r\n\r\n{{-- Intro Lines --}}\r\n@foreach ($introLines as $line)\r\n{{ $line }}\r\n\r\n@endforeach\r\n\r\n{{-- Action Button --}}\r\n@isset($actionText)\r\n&lt;?php\r\n    switch ($level) {\r\n        case 'success':\r\n        case 'error':\r\n            $color = $level;\r\n            break;\r\n        default:\r\n            $color = 'primary';\r\n    }\r\n?&gt;\r\n@component('mail::button', ['url' =&gt; $actionUrl, 'color' =&gt; $color])\r\n{{ $actionText }}\r\n@endcomponent\r\n@endisset\r\n\r\n{{-- Outro Lines --}}\r\n@foreach ($outroLines as $line)\r\n{{ $line }}\r\n\r\n@endforeach\r\n\r\n{{-- Salutation --}}\r\n@if (! empty($salutation))\r\n{{ $salutation }}\r\n@else\r\n<strong>\u3054\u5229\u7528\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01<\/strong>&lt;br&gt;\r\n{{ config('app.name') }}\r\n@endif\r\n\r\n{{-- Subcopy --}}\r\n@isset($actionText)\r\n@slot('subcopy')\r\n@lang(\r\n    <strong>\"\u3082\u3057\u300c:actionText\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3082\u3046\u307e\u304f\u79fb\u52d5\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306eURL\u3092\u76f4\u63a5\u30d6\u30e9\u30a6\u30b6\u306b\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002\\n\",<\/strong>\r\n    [\r\n        'actionText' =&gt; $actionText,\r\n    ]\r\n) &lt;span class=\"break-all\"&gt;[{{ $displayableActionUrl }}]({{ $actionUrl }})&lt;\/span&gt;\r\n@endslot\r\n@endisset\r\n@endcomponent<\/pre>\n<p>\u3053\u308c\u3067\u8a2d\u5b9a\u306f\u5b8c\u4e86\u3067\u3059\uff01<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3057\u3066<code>Email Verification<\/code>\u304c\u65e5\u672c\u8a9e\u5316\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\u307e\u305a\u306f\u3001\u300c<strong>http:\/\/******\/register<\/strong>\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7974\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_1.png\" alt=\"\" width=\"480\" height=\"520\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_1.png 480w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_1-277x300.png 277w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>\u3053\u308c\u307e\u3067\u306a\u3089\u3053\u308c\u3067\u3001\u81ea\u52d5\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u7d42\u4e86\u3067\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u8868\u793a\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7973\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_2.png\" alt=\"\" width=\"480\" height=\"290\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_2.png 480w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_2-300x181.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\ud83d\ude0a<\/p>\n<p>\u3067\u306f\u3001\u8a8d\u8a3c\u30e1\u30fc\u30eb\u304c\u3069\u3046\u306a\u3063\u3066\u3044\u308b\u304b\u3082\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7975\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_5.png\" alt=\"\" width=\"545\" height=\"431\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_5.png 545w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_5-300x237.png 300w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/p>\n<p>\u3053\u3061\u3089\u3082\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\uff01<\/p>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b\u300c<strong>\u8a8d\u8a3c\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306e<code>email_verified_at<\/code>\u306b\u30c7\u30fc\u30bf\u304c\u66f8\u304d\u8fbc\u307e\u308c\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7976\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_6.png\" alt=\"\" width=\"480\" height=\"490\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_6.png 480w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_6-294x300.png 294w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7977\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_7.png\" alt=\"\" width=\"480\" height=\"485\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_7.png 480w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_7-297x300.png 297w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_email_verification_7-100x100.png 100w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u65e5\u6642\u304c\u66f8\u304d\u8fbc\u307e\u308c\u3066\u8a8d\u8a3c\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u5f8c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u30e1\u30fc\u30eb\u8a8d\u8a3c\u304c\u5b8c\u4e86\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>$user = \\App\\Models\\User::find(1);<\/strong>\r\n\r\n<strong>if($user-&gt;hasVerifiedEmail()) {<\/strong>\r\n\r\n<strong>    echo '\u8a8d\u8a3c\u6e08\u307f\u3067\u3059';<\/strong>\r\n\r\n<strong>} else {<\/strong>\r\n\r\n<strong>    echo '\u307e\u3060\u8a8d\u8a3c\u3055\u308c\u3066\u3044\u307e\u305b\u3093';<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u3061\u306a\u307f\u306b\uff1a Cannot send message without a sender address \u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089<\/h1>\n<p><code>.env<\/code>\u306e<code>MAIL_FROM_ADDRESS<\/code>\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\uff08\u3082\u3061\u308d\u3093\u597d\u304d\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067OK\u3067\u3059\ud83d\udc4d\uff09<\/p>\n<pre><strong>MAIL_FROM_ADDRESS=info@example.com<\/strong><\/pre>\n<h1>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=7984&amp;tmstv=1777537065\" rel=\"nofollow\" id=\"download-link-7984\" data-redirect=\"false\" >\n\tLaravel Jetstream\u306eEmail Verification\uff08\u8a8d\u8a3c\u30e1\u30fc\u30eb\uff09\u306e\u4f7f\u3044\u65b9<\/a>\n\n<p>\u203b\u305f\u3060\u3057\u3001\u30e1\u30fc\u30eb\u306e\u8a2d\u5b9a\u306a\u3069\u306f\u3054\u81ea\u8eab\u3067\u5b9f\u88c5\u3057\u3066\u3044\u305f\u3060\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel Jetstream<\/code>\u3067<code>Email Verification<\/code>\u3092\u4f7f\u3046\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u65e5\u672c\u8a9e\u5316\u306b\u306f\u5c11\u3057\u3084\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u304c\u3001<code>Notification<\/code>\u3082\u304b\u3089\u3093\u3067\u3044\u307e\u3059\u306e\u3067\u3001\u52c9\u5f37\u306b\u306a\u308b\u3053\u3068\u306f\u591a\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305c\u3072\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u5225\u306e\u90e8\u5206\u3082\u30d6\u30e9\u30c3\u30b7\u30e5\u30a2\u30c3\u30d7\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3344 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22.png\" alt=\"\" width=\"320\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22.png 320w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_22-100x100.png 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/>\u300c\u72ec\u81ea\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092<br \/>\n\u4f5c\u3089\u306a\u304f\u306a\u3063\u3061\u3083\u3063\u305f\u306a\u30fb\u30fb\u30fb<br \/>\n\u7ba1\u7406\u304c\u5927\u5909\u3067\u3059\u3088\u306d\ud83d\ude02\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dLaravel 8.x\u306e\u76ee\u7389\u6a5f\u80fd\u300cJetstream\u300d\u306e\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u3066\u3044\u307e\u3059\u3002 \u305d\u3057\u3066\u4eca\u56de\u306f\u3001\u300cLaravel Jetstream \u306e\u5404 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=7969\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel Jetstream\u306eEmail Verification\uff08\u8a8d\u8a3c\u30e1\u30fc\u30eb\uff09\u306e\u4f7f\u3044\u65b9&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":7979,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,97],"tags":[81],"class_list":["post-7969","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-97","tag-81"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7969"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7969\/revisions"}],"predecessor-version":[{"id":7990,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7969\/revisions\/7990"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/7979"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}