{"id":7734,"date":"2020-09-21T15:00:38","date_gmt":"2020-09-21T06:00:38","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=7734"},"modified":"2020-09-21T04:45:13","modified_gmt":"2020-09-20T19:45:13","slug":"laravel%e3%81%a7%e3%80%8c%e9%81%95%e5%8f%8d%e3%82%92%e5%a0%b1%e5%91%8a%e3%80%8d%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=7734","title":{"rendered":"Laravel\u3067\u300c\u9055\u53cd\u3092\u5831\u544a\u300d\u6a5f\u80fd\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u79c1\u306f\u3053\u308c\u307e\u3067\u7279\u5b9a\u306e\u4f1a\u793e\u3084\u4f1a\u54e1\u3055\u3093\u30aa\u30f3\u30ea\u30fc\u306e\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u591a\u304f\u958b\u767a\u3057\u3066\u304d\u305f\u306e\u3067\u3059\u304c\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u7531\u306b\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u6295\u7a3f\u3067\u304d\u308b\u30b7\u30b9\u30c6\u30e0\u3082\u3044\u304f\u3064\u304b\u958b\u767a\u3057\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306a\u5834\u5408\u306b\u3042\u3063\u305f\u65b9\u304c\u3044\u3044\u6a5f\u80fd\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u9055\u53cd\u3092\u5831\u544a\u3059\u308b\u6a5f\u80fd<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u6b8b\u5ff5\u306a\u304c\u3089\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306b\u306f\u60aa\u610f\u3092\u3082\u3063\u3066\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u6295\u7a3f\u3059\u308b\u4eba\u304c\u3044\u308b\u306e\u3082\u4e8b\u5b9f\u306a\u306e\u3067\u3001\u3084\u306f\u308a\u4f55\u304b\u4e0d\u9069\u5207\u306a\u3082\u306e\u3092\u767a\u898b\u3057\u305f\u3089\u7ba1\u7406\u8005\u306b\u901a\u5831\u3059\u308b\u6a5f\u80fd\u306f\u3042\u3063\u305f\u307b\u3046\u304c\u3044\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u3001<code>Laravel<\/code> + <code>Vue<\/code>\u3067\u3053\u306e\u300c\u9055\u53cd\u3092\u5831\u544a\u3059\u308b\u300d\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\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\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-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/>\u300c\u304f\u305b\u3063\u6bdb\u3092\u6cbb\u3059\u305f\u3081\u306b<br \/>\n\u30d8\u30a2\u30d4\u30f3\u3067\u77ef\u6b63\u4e2d\u3067\u3059\ud83d\ude02\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 7.x<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u3084\u308a\u305f\u3044\u3053\u3068\u306e\u8a73\u7d30\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u9055\u53cd\u5831\u544a\u3092\u30e1\u30fc\u30eb\u53d7\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<li>\u9055\u53cd\u5831\u544a\u3059\u308b\u30ab\u30c6\u30b4\u30ea\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<li>\u3088\u308a\u6c4e\u7528\u7684\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u3001\u3069\u306e\u30c6\u30fc\u30d6\u30eb\uff08\u30e2\u30c7\u30eb\uff09\u3067\u3082\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3067\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<h1>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u307e\u305a\u3001\u300c\u9055\u53cd\u3092\u5831\u544a\u300d\u6a5f\u80fd\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u3063\u3066\u304a\u304d\u3001\u3053\u306e\u4e2d\u3067\u5404\u7a2e\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>config\/report.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nreturn [\r\n\r\n    \/\/ \u9055\u53cd\u5831\u544a\u3092\u53d7\u4fe1\u3059\u308b\u7ba1\u7406\u8005\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\r\n<strong>    'emails' =&gt; [<\/strong>\r\n<strong>        'admin@example.com',<\/strong>\r\n<strong>    ],<\/strong>\r\n\r\n    \/\/ \u5831\u544a\u30e1\u30fc\u30eb\u306e\u9001\u4fe1\u8005\r\n<strong>    'from' =&gt; 'from@example.com',<\/strong>\r\n\r\n    \/\/ \u5bfe\u8c61\u30e2\u30c7\u30eb\uff08\u30ad\u30fc\u306f\u30c6\u30fc\u30d6\u30eb\u540d\uff09\r\n<strong>    'targets' =&gt; [<\/strong>\r\n<strong>        'posts' =&gt; [<\/strong>\r\n<strong>            'model' =&gt; \\App\\Post::class,<\/strong>\r\n<strong>            'url' =&gt; 'post\/{id}'<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'books' =&gt; [<\/strong>\r\n<strong>            'model' =&gt; \\App\\Book::class,<\/strong>\r\n<strong>            'url' =&gt; function($id) { \/\/ \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3067\u3082OK<\/strong>\r\n\r\n<strong>                return url('\/book\/'. $id);<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n\r\n];<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3001<code>targets<\/code>\u306f\u30ad\u30fc\u304c\u30c6\u30fc\u30d6\u30eb\u540d\uff08\u4f8b\uff1a<code>users<\/code>\uff09\u3067\u3001<code>url<\/code>\u306f\u3001\u5831\u544a\u30e1\u30fc\u30eb\u306b\u542b\u3081\u308b\u30ea\u30f3\u30af\u306b\u4f7f\u308f\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306eURL\u306f\u6b21\u306e\uff12\u30d1\u30bf\u30fc\u30f3\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>{id}\u3092\u7f6e\u63db\u3057\u305f\u3082\u306e\u3092\u4f7f\u7528<\/li>\n<li>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3067 return \u3055\u308c\u305f\u3082\u306e\u3092\u4f7f\u7528<\/li>\n<\/ul>\n<h1>\u30e2\u30c7\u30eb\uff06\u30c6\u30fc\u30d6\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u3001\u9055\u53cd\u5185\u5bb9\u306e\u30ab\u30c6\u30b4\u30ea\u3092\u7ba1\u7406\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3068\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model ReportCategory -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u4e00\u6c17\u306b\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_report_categories_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n<strong>    Schema::create('report_categories', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('name')-&gt;comment('\u30ab\u30c6\u30b4\u30ea\u540d');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u5909\u66f4\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7735\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_1.png\" alt=\"\" width=\"349\" height=\"231\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_1.png 349w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_1-300x199.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<h1>\u30ab\u30c6\u30b4\u30ea\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308bSeeder\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u3064\u304f\u3063\u305f<code>report_categories<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3055\u305b\u308b\u305f\u3081\u306b<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\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:seed ReportCategoriesTableSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>database\/seeds\/ReportCategoriesTableSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function run()\r\n{\r\n    \/\/ \u9055\u53cd\u5185\u5bb9\r\n    <strong>$names = [<\/strong>\r\n<strong>        100 =&gt; '\u66b4\u529b\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4',<\/strong>\r\n<strong>        200 =&gt; '\u5dee\u5225\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4',<\/strong>\r\n<strong>        300 =&gt; '\u6027\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4',<\/strong>\r\n<strong>        400 =&gt; '\u6709\u5bb3\u306a\u30b3\u30f3\u30c6\u30f3\u30c4',<\/strong>\r\n<strong>        500 =&gt; '\u30b9\u30d1\u30e0\u7684\u306a\u30b3\u30f3\u30c6\u30f3\u30c4',<\/strong>\r\n<strong>        999 =&gt; '\u305d\u306e\u4ed6'<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n<strong>    foreach ($names as $id =&gt; $name) {<\/strong>\r\n\r\n<strong>        $category = new \\App\\ReportCategory();<\/strong>\r\n<strong>        $category-&gt;id = $id;<\/strong>\r\n<strong>        $category-&gt;name = $name;<\/strong>\r\n<strong>        $category-&gt;save();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e<code>ReportCategoriesTableSeeder<\/code>\u3092<code>Laravel<\/code>\u306b\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeds\/DatabaseSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function run()\r\n{\r\n     \/\/ $this-&gt;call(UsersTableSeeder::class);\r\n     <strong>$this-&gt;call(ReportCategoriesTableSeeder::class); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3053\u308c\u3067\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30c7\u30fc\u30bf\u3092\u30c6\u30fc\u30d6\u30eb\u306b\u4fdd\u5b58\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan db:seed --class=ReportCategoriesTableSeeder<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u30bc\u30ed\u304b\u3089\u69cb\u7bc9\u3057\u306a\u304a\u3057\u3066\u3082OK\u3067\u3059\u3002<br \/>\n\u305d\u306e\u5834\u5408\u306f\u3053\u3061\u3089\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7738\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_2.png\" alt=\"\" width=\"519\" height=\"390\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_2.png 519w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_2-300x225.png 300w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><\/p>\n<p>\u203b\u306a\u304a\u3001\u306a\u305cID\u3092\u9023\u756a\u306b\u3057\u3066\u3044\u306a\u3044\u304b\u3068\u3044\u3046\u3068\u3001\u5f8c\u304b\u3089\u5225\u306e\u30ab\u30c6\u30b4\u30ea\u3092\u5dee\u3057\u8fbc\u307f\u305f\u3044\u5834\u5408\u306b\u90fd\u5408\u304c\u3044\u3044\u304b\u3089\u3067\u3059\u3002\u9023\u756a\u3060\u3068\u9593\u306b\u5dee\u3057\u8fbc\u3081\u306a\u3044\u306e\u3067\u3002\u3082\u3057\u304f\u306f\u3001<code>sort<\/code>\u306a\u3069\u306e\u9805\u76ee\u3092\u8ffd\u52a0\u3057\u3066\u4e26\u3079\u66ff\u3048\u3067\u304d\u308b\u3088\u3046\u3059\u308b\u306e\u3082\u3044\u3044\u3067\u3059\u306d\ud83d\udc4d<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u9055\u53cd\u5831\u544a\u30d5\u30a9\u30fc\u30e0\u3068\u9001\u4fe1\u5148\u306e\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>Route::get('report\/create', 'ReportController@create');<\/strong>\r\n<strong>Route::post('report', 'ReportController@store');<\/strong><\/pre>\n<p>\u4e0a\u306e\u30eb\u30fc\u30c8\u304c\u9055\u53cd\u5831\u544a\u30d5\u30a9\u30fc\u30e0\u3067\u3001\u4e0b\u306e\u30eb\u30fc\u30c8\u306f<code>Ajax<\/code>\u306e\u9001\u4fe1\u5148\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u4f7f\u3046\u3053\u3068\u306b\u306a\u308b\u72ec\u81ea\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306e\u306f\u4ee5\u4e0b\u306e\uff12\u70b9\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u5bfe\u8c61\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304b\uff1f<\/li>\n<li>\u305d\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u8c61ID\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\uff1f<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:rule HasReportTarget<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Rules\/HasReportTarget.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Rules;\r\n\r\nuse Illuminate\\Contracts\\Validation\\Rule;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\nuse Illuminate\\Support\\Arr;\r\n\r\nclass HasReportTarget implements Rule\r\n{\r\n    <strong>public function __construct()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        \/\/<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function passes($attribute, $id)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $target = request('target');<\/strong>\r\n<strong>        $model = $this-&gt;getModel($target);<\/strong>\r\n\r\n<strong>        return (<\/strong>\r\n<strong>            $model instanceof Model &amp;&amp; \/\/ \u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b<\/strong>\r\n<strong>            $model-&gt;where('id', $id)-&gt;exists() \/\/ \u30c6\u30fc\u30d6\u30eb\u306bID\u304c\u5b58\u5728\u3057\u3066\u3044\u308b<\/strong>\r\n<strong>        );<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function message()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return '\u8a72\u5f53\u30c7\u30fc\u30bf\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002';<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    private function getModel($table) {<\/strong>\r\n\r\n<strong>        $targets = config('report.targets');<\/strong>\r\n\r\n<strong>        if(Arr::exists($targets, $table)) {<\/strong>\r\n\r\n<strong>            $class = config('report.targets')[$table]['model'];<\/strong>\r\n\r\n<strong>            if(class_exists($class)) {<\/strong>\r\n\r\n<strong>                return new $class();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        return null;<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u91cd\u8981\u306a\u306e\u304c\u3001<code>getModel()<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001<code>config\/report.php<\/code>\u3067\u8a2d\u5b9a\u3057\u305f\u30e2\u30c7\u30eb\u3092\u53d6\u5f97\u3057\u3001\u3055\u3089\u306b\u305d\u306e\u30e2\u30c7\u30eb\u306f\u672c\u5f53\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304b\u3089\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b\u306a\u304a\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30a8\u30e9\u30fc\u306f\u7ffb\u8a33\u3055\u305b\u3066\u3044\u307e\u305b\u3093\u3002\u8a73\u3057\u304f\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=289#i-6\" target=\"_blank\" rel=\"noopener noreferrer\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u76f4\u5f8c\u306b\u3084\u308b\u3053\u3068\uff13\u70b9 &gt; \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30e1\u30fc\u30eb\u9001\u4fe1\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5148\u306b\u9055\u53cd\u5831\u544a\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>Mailable\u3092\u3064\u304f\u308b<\/h2>\n<pre><strong>php artisan make:mail Reported<\/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\u307e\u3059\u3002<\/p>\n<p><strong>app\/Mail\/Reported.php<\/strong><\/p>\n<pre><strong>&lt;?php<\/strong>\r\n\r\n<strong>namespace App\\Mail;<\/strong>\r\n\r\n<strong>use Illuminate\\Bus\\Queueable;<\/strong>\r\n<strong>use Illuminate\\Contracts\\Queue\\ShouldQueue;<\/strong>\r\n<strong>use Illuminate\\Mail\\Mailable;<\/strong>\r\n<strong>use Illuminate\\Queue\\SerializesModels;<\/strong>\r\n<strong>use Illuminate\\Support\\Arr;<\/strong>\r\n\r\n<strong>class Reported extends Mailable<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    use Queueable, SerializesModels;<\/strong>\r\n\r\n<strong>    private $data;<\/strong>\r\n\r\n<strong>    public function __construct($data)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;data = $data;<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function build()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $target = $this-&gt;data['target'];<\/strong>\r\n<strong>        $id = $this-&gt;data['id'];<\/strong>\r\n<strong>        $comment = $this-&gt;data['comment'];<\/strong>\r\n<strong>        $category_id = $this-&gt;data['report_category_id'];<\/strong>\r\n<strong>        $category_name = \\App\\ReportCategory::where('id', $category_id)-&gt;value('name');<\/strong>\r\n<strong>        $url_pattern = config('report.targets')[$target]['url'];<\/strong>\r\n<strong>        $url = '';<\/strong>\r\n\r\n<strong>        if(is_string($url_pattern)) { \/\/ \u6587\u5b57\u5217\u306e\u5834\u5408<\/strong>\r\n\r\n<strong>            $url = str_replace('{id}', $id, $url_pattern);<\/strong>\r\n\r\n<strong>        } else if(is_callable($url_pattern)) { \/\/ \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306e\u5834\u5408<\/strong>\r\n\r\n<strong>            $url = $url_pattern($id);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        $emails = config('report.emails');<\/strong>\r\n<strong>        $from = config('report.from');<\/strong>\r\n\r\n<strong>        return $this-&gt;to($emails)<\/strong>\r\n<strong>            -&gt;from($from)<\/strong>\r\n<strong>            -&gt;subject('\u9055\u53cd\u5831\u544a\u304c\u3042\u308a\u307e\u3057\u305f')<\/strong>\r\n<strong>            -&gt;view('emails.reported')<\/strong>\r\n<strong>            -&gt;with([<\/strong>\r\n<strong>                'category_name' =&gt; $category_name,<\/strong>\r\n<strong>                'comment' =&gt; $comment,<\/strong>\r\n<strong>                'url' =&gt; $url,<\/strong>\r\n<strong>            ]);<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u57fa\u672c\u7684\u306a\u30e1\u30fc\u30eb\u9001\u4fe1\u306a\u306e\u3067\u8a73\u3057\u304f\u306f\u5272\u611b\u3057\u307e\u3059\u304c\u3001\u30a4\u30ec\u30ae\u30e5\u30e9\u30fc\u306a\u90e8\u5206\u306f<code>$url<\/code>\u3092\u53d6\u5f97\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u306f\u3001\u6700\u521d\u306b<code>config\/report.php<\/code>\u3067\u8a2d\u5b9a\u3057\u305fURL\u3092\u53d6\u5f97\u3057\u3001\u6587\u5b57\u5217\u3068\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3067\u5206\u5c90\u3092\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30e1\u30fc\u30eb\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff08\u30d3\u30e5\u30fc\uff09\u3092\u3064\u304f\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u6587\u9762\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u4f5c\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/views\/emails\/reported.blade.php<\/strong><\/p>\n<pre><strong>\u9055\u53cd\u5831\u544a\u304c\u3042\u308a\u307e\u3057\u305f\u3002&lt;br&gt;&lt;br&gt;<\/strong>\r\n\r\n<strong>\u8a72\u5f53URL: &lt;a href=\"{{ $url }}\"&gt;{{ $url }}&lt;\/a&gt;&lt;br&gt;<\/strong>\r\n<strong>\u30ab\u30c6\u30b4\u30ea\uff1a {{ $category_name }}&lt;br&gt;<\/strong>\r\n<strong>@if(!empty($comment))<\/strong>\r\n<strong>\u30e1\u30c3\u30bb\u30fc\u30b8\uff1a &lt;br&gt;{!! nl2br($comment) !!}<\/strong>\r\n<strong>@endif<\/strong><\/pre>\n<p>\u3053\u3053\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u304c\u3001<code>nl2br()<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p><code>nl2br()<\/code>\u306f\u3001\u6539\u884c\u30b3\u30fc\u30c9\u3092<code>&lt;br&gt;<\/code>\u306b\u5909\u63db\u3057\u3066\u304f\u308c\u308bPHP\u6a19\u6e96\u95a2\u6570\u3067\u3059\u304c\u3001\u305d\u306e\u5468\u308a\u306e\u57cb\u3081\u8fbc\u307f\u30b3\u30fc\u30c9\u306f<code>{!! ... !!}<\/code>\u3068<strong>\u6587\u5b57\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u300c\u3057\u306a\u3044\u300d\u5f62\u5f0f\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3053\u308c\u306f\u3001\u901a\u5e38\u306e<code>{{ .... }}<\/code>\u3060\u3068\u3001<code>&lt;br&gt;<\/code>\u30bf\u30b0\u304c\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u3066<code>HTML<\/code>\u3067\u306f\u6539\u884c\u306b\u306a\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002<\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30eb\u30fc\u30c8\u3067\u6307\u5b9a\u3057\u305f<code>ReportController<\/code>\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller ReportController<\/strong><\/pre>\n<p>\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\/Http\/Controllers\/ReportController.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse App\\Mail\\Reported;\r\nuse App\\Rules\\HasReportTarget;\r\nuse Illuminate\\Http\\Request;\r\nuse Illuminate\\Validation\\Rules\\Exists;\r\nuse Illuminate\\Validation\\Rules\\In;\r\n\r\nclass ReportController extends Controller\r\n{\r\n    <strong>public function create(Request $request) {<\/strong>\r\n\r\n<strong>        $report_categories = \\App\\ReportCategory::get();<\/strong>\r\n<strong>        return view('report.create')-&gt;with([<\/strong>\r\n<strong>            'id' =&gt; $request-&gt;id,<\/strong>\r\n<strong>            'target' =&gt; $request-&gt;target,<\/strong>\r\n<strong>            'report_categories' =&gt; $report_categories<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function store(Request $request) {<\/strong>\r\n\r\n<strong>        $validated_data = $request-&gt;validate([<\/strong>\r\n<strong>            'id' =&gt; ['required', new HasReportTarget()],<\/strong>\r\n<strong>            'target' =&gt; ['required'],<\/strong>\r\n<strong>            'report_category_id' =&gt; ['required', 'exists:report_categories,id'],<\/strong>\r\n<strong>            'comment' =&gt; ['required_if:report_category_id,999']<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        \\Mail::send(new Reported($validated_data));<\/strong>\r\n\r\n<strong>        return ['result' =&gt; true];<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p><code>create()<\/code>\u306e\u65b9\u304c\u5831\u544a\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3001<code>store()<\/code>\u304c<code>Ajax<\/code>\u306e\u9001\u4fe1\u5148\u306b\u306a\u308a\u3001\u5b9f\u969b\u306b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e<code>store()<\/code>\u306e\u4e2d\u3067\u306f\u5148\u307b\u3069\u3064\u304f\u3063\u305f<code>HasReportTarget()<\/code>\u30eb\u30fc\u30eb\u3092\u4f7f\u3044\u3001\u540c\u3058\u304f\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u901a\u904e\u3057\u305f\u3089<code>Reported()<\/code>\u306e<code>Mailable<\/code>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6700\u5f8c\u306b\u9001\u4fe1\u30d5\u30a9\u30fc\u30e0\u306e\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p><strong>resources\/views\/report\/create.blade.php<\/strong><\/p>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;link rel=\"stylesheet\" href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.5.0\/css\/bootstrap.min.css\"&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>    &lt;div id=\"app\" class=\"p-3\"&gt;<\/strong>\r\n<strong>        &lt;div class=\"row\"&gt;<\/strong>\r\n<strong>            &lt;div class=\"col-4\"&gt;<\/strong>\r\n<strong>                &lt;span class=\"badge badge-info mb-3\"&gt;\u30c6\u30b9\u30c8\u30ea\u30f3\u30af&lt;\/span&gt;<\/strong>\r\n<strong>                &lt;ul class=\"pl-3\"&gt;<\/strong>\r\n<strong>                    &lt;li&gt;<\/strong>\r\n<strong>                        &lt;a href=\"?target=posts&amp;id=3\"&gt;[posts] \u30c6\u30fc\u30d6\u30eb\u306e ID:3 \u3092\u5831\u544a\u3059\u308b&lt;\/a&gt;<\/strong>\r\n<strong>                    &lt;\/li&gt;<\/strong>\r\n<strong>                    &lt;li&gt;<\/strong>\r\n<strong>                        &lt;a href=\"?target=books&amp;id=5\"&gt;[books] \u30c6\u30fc\u30d6\u30eb\u306e ID:5 \u3092\u5831\u544a\u3059\u308b&lt;\/a&gt;<\/strong>\r\n<strong>                    &lt;\/li&gt;<\/strong>\r\n<strong>                    &lt;li&gt;<\/strong>\r\n<strong>                        &lt;a href=\"?target=items&amp;id=4\"&gt;[items] \u30c6\u30fc\u30d6\u30eb\u306e ID:4 \u3092\u5831\u544a\u3059\u308b\uff08\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\uff09&lt;\/a&gt;<\/strong>\r\n<strong>                    &lt;\/li&gt;<\/strong>\r\n<strong>                    &lt;li&gt;<\/strong>\r\n<strong>                        &lt;a href=\".\/create\"&gt;\u30d1\u30e9\u30e1\u30fc\u30bf\u306a\u3057&lt;\/a&gt;<\/strong>\r\n<strong>                    &lt;\/li&gt;<\/strong>\r\n<strong>                &lt;\/ul&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div class=\"col-4\"&gt;<\/strong>\r\n<strong>                &lt;h1 class=\"mb-4\"&gt;\u9055\u53cd\u5831\u544a\u30d5\u30a9\u30fc\u30e0&lt;\/h1&gt;<\/strong>\r\n<strong>                &lt;div class=\"form-group\"&gt;<\/strong>\r\n<strong>                    &lt;div class=\"alert alert-danger\" v-if=\"errors.id\" v-text=\"errors.id\"&gt;&lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;div class=\"alert alert-danger\" v-if=\"errors.target\" v-text=\"errors.target\"&gt;&lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;label&gt;\u30ab\u30c6\u30b4\u30ea&lt;\/label&gt;<\/strong>\r\n<strong>                    &lt;select class=\"form-control\" v-model=\"params.report_category_id\"&gt;<\/strong>\r\n<strong>                        &lt;option value=\"\"&gt;\u25bc\u4ee5\u4e0b\u304b\u3089\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044&lt;\/option&gt;<\/strong>\r\n<strong>                        &lt;option v-for=\"c in reportCategories\" :value=\"c.id\" v-text=\"c.name\"&gt;&lt;\/option&gt;<\/strong>\r\n<strong>                    &lt;\/select&gt;<\/strong>\r\n<strong>                    &lt;div class=\"alert alert-danger\" v-if=\"errors.report_category_id\" v-text=\"errors.report_category_id\"&gt;&lt;\/div&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div class=\"form-group\"&gt;<\/strong>\r\n<strong>                    &lt;label&gt;\u30e1\u30c3\u30bb\u30fc\u30b8&lt;\/label&gt;<\/strong>\r\n<strong>                    &lt;textarea rows=\"7\" class=\"form-control\" v-model=\"params.comment\"&gt;&lt;\/textarea&gt;<\/strong>\r\n<strong>                    &lt;div class=\"alert alert-danger\" v-if=\"errors.comment\" v-text=\"errors.comment\"&gt;&lt;\/div&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div class=\"text-right\"&gt;<\/strong>\r\n<strong>                    &lt;button type=\"button\" class=\"btn btn-danger btn-lg\" @click=\"onSubmit\"&gt;\u5831\u544a\u3059\u308b&lt;\/button&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>    &lt;script&gt;<\/strong>\r\n\r\n<strong>        new Vue({<\/strong>\r\n<strong>            el: '#app',<\/strong>\r\n<strong>            data: {<\/strong>\r\n<strong>                params: {<\/strong>\r\n<strong>                    id: '{{ $id }}',<\/strong>\r\n<strong>                    target: '{{ $target }}',<\/strong>\r\n<strong>                    report_category_id: '',<\/strong>\r\n<strong>                    comment: ''<\/strong>\r\n<strong>                },<\/strong>\r\n<strong>                errors: {},<\/strong>\r\n<strong>                reportCategories: {!! $report_categories !!}<\/strong>\r\n<strong>            },<\/strong>\r\n<strong>            methods: {<\/strong>\r\n<strong>                onSubmit() {<\/strong>\r\n\r\n<strong>                    if(confirm('\u9055\u53cd\u5831\u544a\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) {<\/strong>\r\n\r\n<strong>                        this.errors = {};<\/strong>\r\n<strong>                        const url = '\/report';<\/strong>\r\n<strong>                        axios.post(url, this.params)<\/strong>\r\n<strong>                            .then(response =&gt; {<\/strong>\r\n\r\n<strong>                                if(response.data.result === true) {<\/strong>\r\n\r\n<strong>                                    alert('\u5831\u544a\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f');<\/strong>\r\n\r\n<strong>                                    this.params.report_category_id = '';<\/strong>\r\n<strong>                                    this.params.comment = '';<\/strong>\r\n\r\n<strong>                                }<\/strong>\r\n\r\n<strong>                            })<\/strong>\r\n<strong>                            .catch(error =&gt; {<\/strong>\r\n\r\n<strong>                                const responseErrors = error.response.data.errors;<\/strong>\r\n<strong>                                let errors = {};<\/strong>\r\n\r\n<strong>                                for(const key in responseErrors) {<\/strong>\r\n\r\n<strong>                                    errors[key] = '\u26a0 '+ responseErrors[key][0];<\/strong>\r\n\r\n<strong>                                }<\/strong>\r\n\r\n<strong>                                this.errors = errors;<\/strong>\r\n\r\n<strong>                            });<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        });<\/strong>\r\n\r\n<strong>    &lt;\/script&gt;<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u91cd\u8981\u306a\u306e\u304c\u3001<code>Vue<\/code>\u5185\u306e<code>params<\/code>\u3068<code>reportCategories<\/code>\u3067\u3059\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u3053\u3053\u306e\u30c7\u30fc\u30bf\u306f<code>Laravel<\/code>\u5074\u304b\u3089\u3084\u3063\u3066\u304d\u305f\u3082\u306e\u3092\u30b3\u30fc\u30c9\u3068\u3057\u3066\u51fa\u529b\u3057\u3001\u305d\u306e\u51fa\u529b\u3057\u305f\u3082\u306e\u304c<code>Vue<\/code>\u30b3\u30fc\u30c9\u306e\u4e00\u90e8\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3089\u3067\u3001\u3064\u307e\u308a<code>PHP<\/code>\u3068<code>JavaScript<\/code>\u304c\u9023\u643a\u3057\u3066\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001<code>posts<\/code>\u30c6\u30fc\u30d6\u30eb\u3092\u3064\u304f\u308a\u3001\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u4ee5\u4e0b\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><strong>https:\/\/******\/report\/create<\/strong><\/p>\n<p>\u3059\u308b\u3068\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u300c\u5831\u544a\u3059\u308b\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7741\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_3.png\" alt=\"\" width=\"434\" height=\"462\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_3.png 434w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_3-282x300.png 282w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7742\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_4.png\" alt=\"\" width=\"324\" height=\"319\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_4.png 324w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/08\/laravel_report_4-300x295.png 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u203b\u306a\u304a\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306e\u30c6\u30b9\u30c8\u3092\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/mailcatcher.me\/\" target=\"_blank\" rel=\"noopener noreferrer\">MailCatcher<\/a>\u304c\u4fbf\u5229\u3067\u3059\u3088\ud83d\udc4d<\/p>\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=7758&amp;tmstv=1777532210\" rel=\"nofollow\" id=\"download-link-7758\" data-redirect=\"false\" >\n\t\u300c\u9055\u53cd\u3092\u5831\u544a\u300d\u6a5f\u80fd\u3092\u3064\u304f\u308b<\/a>\n\n<p>\u203b\u305f\u3060\u3057\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u7b49\u306f\u3054\u81ea\u8eab\u3067\u884c\u3063\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\u300c<strong>\u9055\u53cd\u3092\u5831\u544a\u3059\u308b<\/strong>\u300d\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><code>YouTube<\/code>\u3067\u3082<code>Twitter<\/code>\u3067\u3082\u305d\u3046\u3067\u3059\u304c\u3001\u3084\u306f\u308a\u30e6\u30fc\u30b6\u30fc\u304c\u5897\u3048\u3066\u304f\u308b\u3068\u4e88\u671f\u3057\u306a\u3044\u4f7f\u3044\u65b9\u3092\u3059\u308b\u4eba\u304c\u51fa\u3066\u304f\u308b\u3082\u306e\u3067\u3059\u306e\u3067\u3001\u3053\u3046\u3044\u3063\u305f\u6a5f\u80fd\u304c\u3042\u308c\u3070\u5c11\u3057\u306f\u5bfe\u51e6\u3057\u3084\u3059\u304f\u306a\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001\u4e0d\u9069\u5207\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u6295\u7a3f\u3059\u308b\u5074\u304b\u3089\u3057\u3066\u3082\u300c<strong>\u3042\uff01\u901a\u5831\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305e\ud83d\ude2b<\/strong>\u300d\u3068\u306a\u308b\u3068\u3001\u3081\u3063\u305f\u306a\u3053\u3068\u306f\u3067\u304d\u306a\u304f\u306a\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u3001\u4e88\u9632\u52b9\u679c\u3082\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u307f\u306a\u3055\u3093\u3082\u3084\u3063\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-4445\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><br \/>\n\u300cSPY x Family \u3063\u3066\u3044\u3046\u6f2b\u753b\u3001<br \/>\n\u9762\u767d\u3044\u3067\u3059\u306d\ud83d\udc4d\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u79c1\u306f\u3053\u308c\u307e\u3067\u7279\u5b9a\u306e\u4f1a\u793e\u3084\u4f1a\u54e1\u3055\u3093\u30aa\u30f3\u30ea\u30fc\u306e\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u591a\u304f\u958b\u767a\u3057\u3066\u304d\u305f\u306e\u3067\u3059\u304c\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u7531\u306b\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u6295\u7a3f\u3067\u304d\u308b\u30b7\u30b9\u30c6\u30e0\u3082\u3044 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=7734\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel\u3067\u300c\u9055\u53cd\u3092\u5831\u544a\u300d\u6a5f\u80fd\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":7754,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12,97],"tags":[81],"class_list":["post-7734","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-vue-js","category-97","tag-81"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7734","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=7734"}],"version-history":[{"count":13,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7734\/revisions"}],"predecessor-version":[{"id":7761,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7734\/revisions\/7761"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/7754"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}