{"id":449,"date":"2018-04-06T20:41:12","date_gmt":"2018-04-06T11:41:12","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=449"},"modified":"2018-04-11T05:08:53","modified_gmt":"2018-04-10T20:08:53","slug":"%e3%81%9f%e3%81%a3%e3%81%9f%ef%bc%93%e3%82%b9%e3%83%86%e3%83%83%e3%83%97%ef%bc%81laravel%e3%81%a7%e4%bb%ae%e7%99%bb%e9%8c%b2%e2%86%92%e6%9c%ac%e7%99%bb%e9%8c%b2%e3%82%92%e5%ae%9f%e8%a3%85%e3%81%99","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=449","title":{"rendered":"\u305f\u3063\u305f\uff13\u30b9\u30c6\u30c3\u30d7\uff01Laravel\u3067\u4eee\u767b\u9332\u2192\u672c\u767b\u9332\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u306e<a href=\"https:\/\/blog.capilano-fw.com\/?p=420\">\u30b7\u30f3\u30d7\u30eb\uff01Laravel5.6\u3067\u300c\u6a29\u9650\u3064\u304d\u300d\u30ed\u30b0\u30a4\u30f3\u3055\u305b\u308b\u65b9\u6cd5<\/a>\u3067\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001Laravel\u306b\u306f\u59cb\u3081\u304b\u3089\u8272\u3005\u306a\u6a5f\u80fd\u304c\u5099\u308f\u3063\u3066\u3044\u3066\u4fbf\u5229\u3067\u3059\u304c\u3001\u4e2d\u306b\u306f\u81ea\u5206\u3067\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u90e8\u5206\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304c\u4eca\u56de\u306e<strong>\u300c\u4eee\u767b\u9332\u2192\u672c\u767b\u9332\u300d\u6a5f\u80fd\u306e\u5b9f\u88c5\u3067\u3059\u3002<\/strong><\/p>\n<p>\u6d41\u308c\u3068\u3057\u3066\u306f\u3001<\/p>\n<ol>\n<li><strong>\u30e6\u30fc\u30b6\u30fc\u767b\u9332\uff08\u4eee\u767b\u9332\uff09<\/strong><\/li>\n<li><strong>\u672c\u767b\u9332URL\u3092\u30e1\u30fc\u30eb\u9001\u4fe1<\/strong><\/li>\n<li><strong>\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u672c\u767b\u9332\u5b8c\u4e86<\/strong><\/li>\n<\/ol>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u5b8c\u5168\u306b\u81ea\u524d\u3067\u5b9f\u88c5\u3059\u308b\u3068\u306a\u308b\u3068\u306a\u304b\u306a\u304b\u5927\u5909\u306a\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u306f\u4eba\u6c17\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306eLaravel\u3002\u4fbf\u5229\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u305f\u3063\u305f\uff13\u30b9\u30c6\u30c3\u30d7\u3067\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>\u3010\u958b\u767a\u74b0\u5883\u3011<\/h1>\n<ul>\n<li>Laravel 5.6.15<\/li>\n<li>PHP 7.2<\/li>\n<li>Apache 2.4<\/li>\n<li>Ubuntu 16.04<\/li>\n<\/ul>\n<p>\u203b\u3059\u3067\u306bphp artisan make:auth\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a8d\u8a3c\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u524d\u63d0\u3067\u3059\u3002<\/p>\n<h1>\uff11\uff0e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n<p>\u5229\u7528\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u306f\u3001\u300c<a href=\"https:\/\/github.com\/jrean\/laravel-user-verification\" target=\"_blank\" rel=\"noopener\" data-pjax=\"#js-repo-pjax-container\">laravel-user-verification<\/a>\u300d\u3067\u3059\u3002<br \/>\ncomposer\u304b\u3089\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>composer require jrean\/laravel-user-verification:dev-master<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan migrate --path=\"\/vendor\/jrean\/laravel-user-verification\/src\/resources\/migrations\"<\/strong><\/pre>\n<p>\u3053\u306e\u5b9f\u884c\u3067\u3001users\u30c6\u30fc\u30d6\u30eb\u306b\u4ee5\u4e0b\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>verified<\/strong><\/li>\n<li><strong>verification_token<\/strong><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-451\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/user-verification-table-1.png\" alt=\"\" width=\"373\" height=\"338\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/user-verification-table-1.png 373w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/user-verification-table-1-300x272.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/p>\n<h1>\uff12\uff0e\u6e96\u5099<\/h1>\n<p><strong>app\/Http\/Controllers\/Auth\/RegisterController.php<\/strong>\u306e\u4e2d\u3067\u3001\u4ee5\u4e0b\uff13\u3064\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>VerifiesUsers<\/strong>\u3092\u8aad\u307f\u8fbc\u307f<\/li>\n<li>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u4e2d\u8eab\u3092\u5909\u66f4<\/li>\n<li><strong>register()<\/strong>\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9<\/li>\n<\/ul>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers\\Auth;\r\n\r\nuse App\\User;\r\nuse App\\Http\\Controllers\\Controller;\r\n<strong>use Illuminate\\Http\\Request;<\/strong>\r\n<strong>use Illuminate\\Auth\\Events\\Registered;<\/strong>\r\n<strong>use Illuminate\\Support\\Facades\\Validator;<\/strong>\r\n<strong>use Illuminate\\Foundation\\Auth\\RegistersUsers;<\/strong>\r\n<strong>use Jrean\\UserVerification\\Traits\\VerifiesUsers;<\/strong>\r\n<strong>use Jrean\\UserVerification\\Facades\\UserVerification;<\/strong>\r\n\r\nclass RegisterController extends Controller\r\n{\r\n    \/* \u7701\u7565 *\/\r\n\r\n    <strong>use VerifiesUsers;<\/strong>\r\n\r\n    \/* \u7701\u7565 *\/\r\n\r\n<strong>    public function __construct()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;middleware('guest', ['except' =&gt; ['getVerification', 'getVerificationError']]);<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n    \/* \u7701\u7565 *\/\r\n\r\n    <strong>public function register(Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;validator($request-&gt;all())-&gt;validate();<\/strong>\r\n\r\n<strong>        $user = $this-&gt;create($request-&gt;all());<\/strong>\r\n\r\n<strong>        event(new Registered($user));<\/strong>\r\n\r\n<strong>\u3000\u3000\u3000\u3000\u3000$this-&gt;guard()-&gt;login($user);<\/strong>\r\n\r\n<strong>        UserVerification::generate($user);<\/strong>\r\n\r\n<strong>        UserVerification::send($user, '\u4eee\u767b\u9332\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f');<\/strong>\r\n\r\n<strong>        return $this-&gt;registered($request, $user)<\/strong>\r\n<strong>            ?: redirect($this-&gt;redirectPath());<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u203buse *****\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u5143\u3005\u306f\u30c8\u30ec\u30a4\u30c8\u5185\u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3068\u547c\u3073\u51fa\u305b\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u306f\u3001\u672c\u767b\u9332\u30da\u30fc\u30b8\u3067\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u304c\u9069\u7528\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u9069\u7528\u3055\u308c\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u6e08\u307f\u3068\u3044\u3046\u3053\u3068\u3067\u81ea\u52d5\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u307e\u3060\u672c\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u4f8b\u5916\u3092\u51fa\u3059\u3088\u3046\u306b\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u767b\u9332\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>app\/Http\/Kernel.php<\/strong><\/p>\n<pre><strong>protected $routeMiddleware = [<\/strong>\r\n<strong>    \/*  \u7701\u7565  *\/<\/strong>\r\n<strong>    'isVerified' =&gt; \\Jrean\\UserVerification\\Middleware\\IsVerified::class,<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u300cisVerified\u300d\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u30da\u30fc\u30b8\u306f\u672c\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u3068\u30a8\u30e9\u30fc\uff08\u4f8b\u5916\uff09\u304c\u767a\u751f\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\uff13\uff0e\u898b\u305f\u76ee\u3092\u5909\u66f4\u3059\u308b\uff08\u4efb\u610f\uff09<\/h1>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068\u3001\u672c\u767b\u9332\u30e1\u30fc\u30eb\u306f\u82f1\u8a9e\u306b\u306a\u3063\u3066\u3044\u305f\u308a\u3059\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u5909\u66f4\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\uff08\u3082\u3057\u5fc5\u8981\u306a\u3044\u4eba\u306f\u6b21\u306e\u9805\u76ee\u307e\u3067\u8aad\u307f\u98db\u3070\u3057\u3066\u4e0b\u3055\u3044\uff09<\/p>\n<p>\u5909\u66f4\u3059\u308b\u306e\u306f\u4ee5\u4e0b\u306e\uff13\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li><strong>\u672c\u767b\u9332\u30e1\u30fc\u30eb\u306e\u65e5\u672c\u8a9e\u5316<\/strong><\/li>\n<li><strong>\u672c\u767b\u9332\u30fb\u5931\u6557\u30da\u30fc\u30b8\u306e\u65e5\u672c\u8a9e\u5316<\/strong><\/li>\n<li><strong>\u672c\u767b\u9332\u304c\u307e\u3060\u3067\u304d\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u30a8\u30e9\u30fc\u30da\u30fc\u30b8<\/strong><\/li>\n<\/ul>\n<h2>\u672c\u767b\u9332\u30e1\u30fc\u30eb\u306e\u65e5\u672c\u8a9e\u5316<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-453\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_email.png\" alt=\"\" width=\"423\" height=\"179\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_email.png 423w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_email-300x127.png 300w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/p>\n<p>\u307e\u305a\u306f\u672c\u767b\u9332\u30e1\u30fc\u30eb\u306e\u5185\u5bb9\u3067\u3059\u3002<br \/>\n\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d3\u30e5\u30fc\u3092publish\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan vendor:publish --provider=\"Jrean\\UserVerification\\UserVerificationServiceProvider\" --tag=\"views\"<\/strong><\/pre>\n<p>\u5b9f\u884c\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001<\/p>\n<p><strong>resources\/views\/vendor\/laravel-user-verification<\/strong><\/p>\n<p>\u306e\u4e2d\u306b\uff13\u3064\u306e\u30d3\u30e5\u30fc\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30e1\u30fc\u30eb\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001\u300c<strong>email.blade.php<\/strong>\u300d\u306e\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u4fdd\u5b58\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<pre>\u4ee5\u4e0b\u306eURL\u304b\u3089\u672c\u767b\u9332\u3092\u5b8c\u4e86\u3055\u305b\u3066\u304f\u3060\u3055\u3044\u3002\r\n\r\n\u672c\u767b\u9332URL: &lt;a href=\"{{ $link = route('email-verification.check', $user-&gt;verification_token) . '?email=' . urlencode($user-&gt;email) }}\"&gt;{{ $link }}&lt;\/a&gt;<\/pre>\n<h2>\u672c\u767b\u9332\u30fb\u5931\u6557\u30da\u30fc\u30b8\u306e\u65e5\u672c\u8a9e\u5316<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-456\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_failed.png\" alt=\"\" width=\"844\" height=\"274\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_failed.png 844w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_failed-300x97.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/verification_failed-768x249.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u6b21\u306b\u672c\u767b\u9332\u304c\u306a\u3093\u3089\u304b\u306e\u7406\u7531\u3067\u5931\u6557\u3057\u305f\u5834\u5408\u3001<\/p>\n<pre><strong>http:\/\/l56.test\/email-verification\/error<\/strong><\/pre>\n<p>\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3055\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u30da\u30fc\u30b8\u3082\u3055\u3063\u304dpublish\u3057\u305f\u30d3\u30e5\u30fc\u3067\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\uff08<strong>user-verification.blade.php<\/strong>\uff09<\/p>\n<pre>@extends('layouts.app')\r\n\r\n&lt;!-- Main Content --&gt;\r\n@section('content')\r\n&lt;div class=\"container\"&gt;\r\n    &lt;div class=\"row\"&gt;\r\n        &lt;div class=\"col-md-8 col-md-offset-2\"&gt;\r\n            &lt;h1&gt;\u672c\u767b\u9332\u30fb\u8a8d\u8a3c\u30a8\u30e9\u30fc&lt;\/h1&gt;\r\n            &lt;div class=\"panel-body\"&gt;\r\n                &lt;span class=\"help-block\"&gt;\r\n                    &lt;strong&gt;\u672c\u767b\u9332\u306e\u8a8d\u8a3c\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002URL\u304c\u9014\u4e2d\u3067\u9014\u5207\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3046\u4e00\u5ea6\u304a\u78ba\u304b\u3081\u306e\u4e0a\u3001\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/strong&gt;\r\n                &lt;\/span&gt;\r\n                &lt;br&gt;\r\n                &lt;br&gt;\r\n                &lt;a href=\"{{url('\/')}}\" class=\"btn btn-primary\"&gt;\r\n                    \u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3078\u623b\u308b\r\n                &lt;\/a&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n@endsection<\/pre>\n<p>\u203b\u5143\u3005\u306ftrans()\u3092\u4f7f\u3063\u3066\u591a\u8a00\u8a9e\u5316\u306b\u5bfe\u5fdc\u3055\u305b\u3066\u3044\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u30b5\u30f3\u30d7\u30eb\u3068\u3044\u3046\u3053\u3068\u3067\u76f4\u63a5\u6587\u7ae0\u3092\u304b\u304d\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<h2>\u672c\u767b\u9332\u304c\u307e\u3060\u3067\u304d\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u30a8\u30e9\u30fc\u30da\u30fc\u30b8<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-455\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/not_verified.png\" alt=\"\" width=\"914\" height=\"163\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/not_verified.png 914w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/not_verified-300x54.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/not_verified-768x137.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u6700\u5f8c\u306b\u3001\u672c\u767b\u9332\u3057\u3066\u3044\u306a\u3044\u306e\u306b\u8a72\u5f53\u30da\u30fc\u30b8\u3078\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3089\u8868\u793a\u3059\u308b\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\uff08\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u300c<strong>\\Jrean\\UserVerification\\Middleware\\IsVerified<\/strong>\u300d\u3067\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc\u3067\u3059\uff09<\/p>\n<p>\u307e\u305a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30a8\u30e9\u30fc\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\uff08resources\/views\/errors\/not_verified.blade.php\uff09<\/strong><\/p>\n<pre>@extends('layouts.app')\r\n\r\n&lt;!-- Main Content --&gt;\r\n@section('content')\r\n    &lt;div class=\"container\"&gt;\r\n        &lt;div class=\"row\"&gt;\r\n            &lt;div class=\"col-md-8 col-md-offset-2\"&gt;\r\n                &lt;h1&gt;\u672c\u767b\u9332\u304c\u5b8c\u4e86\u3057\u3066\u3044\u307e\u305b\u3093\u3002&lt;\/h1&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n@endsection<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308bHandler.php\u5185\u3067\u547c\u3073\u51fa\u3059\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\uff08<strong>app\/Exceptions\/Handler.php<\/strong>\uff09<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Exceptions;\r\n\r\nuse Exception;\r\nuse Illuminate\\Foundation\\Exceptions\\Handler as ExceptionHandler;\r\n<strong>use Jrean\\UserVerification\\Exceptions\\UserNotVerifiedException;<\/strong>\r\n\r\nclass Handler extends ExceptionHandler\r\n{\r\n    \/* \u7701\u7565 *\/\r\n    public function render($request, Exception $exception)\r\n    {\r\n<strong>        if ($exception instanceof UserNotVerifiedException) {<\/strong>\r\n\r\n<strong>            return response()-&gt;view('errors.not_verified', [], 500);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n        return parent::render($request, $exception);\r\n    }\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u3001\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h1>\u5b9f\u969b\u306b\u78ba\u304b\u3081\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001Route\u306b\u672c\u767b\u9332\u304c\u5b8c\u4e86\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u3060\u3051\u304c\u898b\u3089\u308c\u308b\u30da\u30fc\u30b8\u3092\u767b\u9332\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>Route::group(<strong>['middleware' =&gt; ['auth', 'isVerified']<\/strong>], function () {\r\n\r\n    Route::get('\/user\/home', function(){\r\n\r\n        return '\u30ed\u30b0\u30a4\u30f3\u3082\u3067\u304d\u3066\u308b\u3057\u3001\u672c\u767b\u9332\u3082\u5b8c\u4e86\u3057\u3066\u307e\u3059\uff01';\r\n\r\n    });\r\n\r\n});<\/pre>\n<p>\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3068\u3057\u3066\u3001<\/p>\n<ul>\n<li><strong>auth\u3000\u30fb\u30fb\u30fb\u3000\u901a\u5e38\u306e\u30ed\u30b0\u30a4\u30f3<\/strong><\/li>\n<li><strong>isVerified\u3000\u30fb\u30fb\u30fb\u3000\u672c\u767b\u9332\u304c\u5b8c\u4e86\u3057\u3066\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30df\u30c9\u30eb\u30a6\u30a7\u30a2<\/strong><\/li>\n<\/ul>\n<p>\u306e\uff12\u3064\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u72b6\u614b\u3067\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u308b\u3068\u3001\u300c\u672c\u767b\u9332\u304c\u307e\u3060\u3067\u304d\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u300d\u3067\u4f5c\u6210\u3057\u305f\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>http:\/\/example.com\/user\/home<\/strong><\/pre>\n<p>\u3082\u3061\u308d\u3093\u3001\u672c\u767b\u9332\u3092\u6e08\u307e\u305b\u3066\u3042\u308b\u5834\u5408\u306f\u30a8\u30e9\u30fc\u30da\u30fc\u30b8\u306f\u8868\u793a\u3055\u308c\u305a\u3001\u3053\u306e\u5834\u5408\u3060\u3068\u300c<strong>\u30ed\u30b0\u30a4\u30f3\u3082\u3067\u304d\u3066\u308b\u3057\u3001\u672c\u767b\u9332\u3082\u5b8c\u4e86\u3057\u3066\u307e\u3059\uff01<\/strong>\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306fLaravel\u3067\u300c\u4eee\u767b\u9332\u2192\u672c\u767b\u9332\u300d\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u304a\u5f79\u306b\u7acb\u3066\u305f\u3089\u5e78\u3044\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-418 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/35.png\" alt=\"\" width=\"370\" height=\"240\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/35.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/35-300x195.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u306e\u30b7\u30f3\u30d7\u30eb\uff01Laravel5.6\u3067\u300c\u6a29\u9650\u3064\u304d\u300d\u30ed\u30b0\u30a4\u30f3\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001Laravel\u306b\u306f\u59cb\u3081\u304b\u3089\u8272\u3005\u306a\u6a5f\u80fd\u304c\u5099\u308f\u3063\u3066\u3044\u3066\u4fbf\u5229\u3067\u3059\u304c\u3001\u4e2d &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=449\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u305f\u3063\u305f\uff13\u30b9\u30c6\u30c3\u30d7\uff01Laravel\u3067\u4eee\u767b\u9332\u2192\u672c\u767b\u9332\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":457,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[61],"class_list":["post-449","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-61"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/449","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=449"}],"version-history":[{"count":2,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/449\/revisions"}],"predecessor-version":[{"id":458,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/449\/revisions\/458"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/457"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}