{"id":7148,"date":"2020-04-24T15:00:36","date_gmt":"2020-04-24T06:00:36","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=7148"},"modified":"2020-04-24T02:07:02","modified_gmt":"2020-04-23T17:07:02","slug":"%e3%80%90laravel%e3%80%91%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e3%82%a2%e3%83%83%e3%83%97%e3%83%ad%e3%83%bc%e3%83%89%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b%ef%bc%88%e3%83%80","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=7148","title":{"rendered":"\u3010Laravel\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u3064\u304f\u308b\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5300\u8a18\u4e8b\u3092\u7a81\u7834\u3057\u305f\u306e\u3067\u904e\u53bb\u306e\u5185\u5bb9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001<strong>\u300c\u3042\u308c\u3001\u8a18\u4e8b\u306b\u3057\u3066\u306a\u304b\u3063\u305f\u3063\u3051\u2753\u2753\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/strong><\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">Laravel\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u6a5f\u80fd<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u904e\u53bb\u306b\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3092\u52b9\u7387\u5316\u3059\u308b\u72ec\u81ea\u30d1\u30c3\u30b1\u30fc\u30b8\u300c<a href=\"https:\/\/github.com\/SUKOHI\/ClampBolt\" target=\"_blank\" rel=\"noopener noreferrer\">ClampBolt<\/a>\u300d\u3092\u516c\u958b\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u3066\u3063\u304d\u308a\u8a18\u4e8b\u3068\u3057\u3066\u516c\u958b\u3057\u3066\u3044\u308b\u3082\u306e\u3068\u52d8\u9055\u3044\u3057\u3066\u3044\u307e\u3057\u305f\ud83d\ude02<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f<code>Laravel<\/code>\u3067<strong>\u9867\u5ba2\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\uff06\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u753b\u50cf\u3082\u4e00\u7dd2\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u304d\u308b\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u305c\u3072\u697d\u3057\u307f\u306a\u304c\u3089\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\uff08\u306a\u304a\u3001\u6839\u672c\u3092\u7406\u89e3\u3057\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u306e\u3067\u3001\u4eca\u56de<code>ClampBolt<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4f7f\u3044\u307e\u305b\u3093m_ _\uff09<\/p>\n<p><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\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u3067\u304d\u308b\u3060\u3051\u4ed6\u3067\u3082\u4f7f\u3044\u3084\u3059\u3044\u5f62\u306b\u3057\u307e\u3059\ud83d\udc4d\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 7.x<\/p>\n<h1>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h1>\n<p>\u307e\u305a\u306fDB\u95a2\u9023\u304b\u3089\u3084\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u30e2\u30c7\u30eb\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3068\u3082\u306b\u4ee5\u4e0b\uff12\u3064\u305a\u3064\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>Customer\uff1a \u9867\u5ba2\u30c7\u30fc\u30bf<\/li>\n<li>Attachment\uff1a \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb<\/li>\n<\/ul>\n<h2>\u9867\u5ba2\u3092\u7ba1\u7406\u3059\u308b\u300cCustomer\u300d<\/h2>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4e00\u6c17\u306b\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model -m Customer<\/strong><\/pre>\n<p>\u2460\u30e2\u30c7\u30eb<\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3089\u3001\u307e\u305a\u30e2\u30c7\u30eb\u306e\u4e2d\u8eab\u3092\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/app\/Customer.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Customer extends Model\r\n{\r\n    \/\/ \u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\r\n    <strong>public function attachments() {<\/strong>\r\n\r\n<strong>        return $this-&gt;hasMany('App\\Attachment', 'parent_id', 'id')<\/strong>\r\n<strong>            -&gt;where('model', self::class);  \/\/ \u300cApp\\Customer\u300d\u306e\u3082\u306e\u3060\u3051\u53d6\u5f97<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u300c1\uff1a\u591a\u300d\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u901a\u5e38\u3068\u5c11\u3057\u9055\u3046\u306e\u304c<code>where()<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3001<code>Customer<\/code>\u30e2\u30c7\u30eb\u306b\u95a2\u9023\u3059\u308b\u30c7\u30fc\u30bf\u3060\u3051\u53d6\u5f97\u3059\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u3088\u308a\u8a73\u3057\u304f\u8a00\u3046\u3068\u3001<\/p>\n<ul>\n<li>\u300cattachments.parent_id\u300d\uff1d\u300ccustomers.id\u300d<\/li>\n<li>\u300cattachments.model\u300d\uff1d\u300cApp\\Customer\u300d<\/li>\n<\/ul>\n<p>\u306e\u30c7\u30fc\u30bf\u304c<code>hasMany()<\/code>\u3067\u7d50\u5408\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u203b\u306a\u304a\u3001\u3053\u306e\u5f62\u3067\u5b9f\u88c5\u3057\u305f\u306e\u306f<strong>\u4ed6\u306e\u30e2\u30c7\u30eb\u3067\u30d5\u30a1\u30a4\u30eb\u30fb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u5834\u5408\u306b\u3082\u5fdc\u7528\u3057\u3084\u3059\u3044\u304b\u3089\u3067\u3059\ud83d\udc4d<\/strong><\/p>\n<p>\u2461\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/p>\n<p>\u305d\u3057\u3066\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u3053\u3053\u306f\u30b7\u30f3\u30d7\u30eb\u306b\u9867\u5ba2\u30c7\u30fc\u30bf\u306b\u300c\u540d\u524d\u300d\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u306e\u9805\u76ee\u3092\u3064\u304f\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p><strong><code>\/database\/migrations\/****_**_**_******_create_customers_table.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('customers', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('name')-&gt;comment('\u540d\u524d');<\/strong>\r\n<strong>        $table-&gt;string('email')-&gt;comment('\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h2>\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u7ba1\u7406\u3059\u308b\u300cAttachment\u300d<\/h2>\n<p>\u7d9a\u3044\u3066\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406\u3092\u3059\u308b<code>Attachment<\/code>\u3067\u3059\u3002<\/p>\n<p>\u2460\u30e2\u30c7\u30eb<\/p>\n<pre><strong>php artisan make:model -m Attachment<\/strong><\/pre>\n<p>\u2461\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/p>\n<p><strong><code>\/database\/migrations\/****_**_**_******_create_attachments_table.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('attachments', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;integer('parent_id');<\/strong>\r\n<strong>        $table-&gt;string('model')-&gt;comment('\u30e2\u30c7\u30eb\u540d');<\/strong>\r\n<strong>        $table-&gt;string('path')-&gt;comment('\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9');<\/strong>\r\n<strong>        $table-&gt;string('key')-&gt;comment('\u30ad\u30fc');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u9805\u76ee\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>parent_id\uff1a \u5404\u30c6\u30fc\u30d6\u30eb\u306e\u300cid\u300d\uff08\u4f8b\uff1a customers\u306eid\uff09<\/li>\n<li>model\uff1a \u30e2\u30c7\u30eb\u540d\uff08\u4f8b\uff1aApp\\Customer\uff09<\/li>\n<li>key\uff1a \u4f55\u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u30ad\u30fc\uff08\u4f8b\uff1a profile_photos\uff09<\/li>\n<\/ul>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u5b9f\u884c<\/h2>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7149\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_1.png\" alt=\"\" width=\"360\" height=\"253\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_1.png 360w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_1-300x211.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7150\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_2.png\" alt=\"\" width=\"349\" height=\"295\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_2.png 349w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_2-300x254.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u30eb\u30fc\u30c8\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308bURL\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong><code>\/routes\/web.php<\/code><\/strong><\/p>\n<pre><strong>Route::get('customer\/create', 'CustomerController@create');<\/strong> \/\/ \u9001\u4fe1\u30d5\u30a9\u30fc\u30e0<strong>\r\nRoute::post('ajax\/customer', 'CustomerController@store');   <\/strong>\/\/ Ajax\u3067\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308b<strong>\r\nRoute::get('customer\/test', 'CustomerController@test');     <\/strong>\/\/ \u30c6\u30b9\u30c8\u7528<\/pre>\n<p>\uff11\u884c\u76ee\u306f\u9001\u4fe1\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u30eb\u30fc\u30c8\u3067\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u305d\u306e\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308b\u306e\u304c\uff12\u884c\u76ee\u3002<br \/>\n\u6700\u5f8c\u306e\uff13\u884c\u76ee\u306f\u30c6\u30b9\u30c8\u7528\u306b\u306a\u308a\u307e\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\u8a2d\u5b9a\u3057\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u3063\u3066\u3044\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<pre><strong>php artisan make:controller CustomerController<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Http\/Controllers\/CustomerController.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass CustomerController extends Controller\r\n{\r\n    <strong>public function create() { \/\/ \ud83d\udc48 \u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a \u30fb\u30fb\u30fb \u2460\r\n\r\n        return view('customer.create');\r\n\r\n    }\r\n\r\n    public function store(Request $request) { \/\/ \ud83d\udc48 Ajax\u30c7\u30fc\u30bf\u53d7\u4fe1 \u30fb\u30fb\u30fb \u2461\r\n\r\n        \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\r\n        $request-&gt;validate([\r\n            'name' =&gt; 'required',\r\n            'email' =&gt; 'required|email',\r\n            'photos' =&gt; 'required',\r\n            'photos.*' =&gt; 'image'\r\n        ]);\r\n\r\n        \/\/ \u9867\u5ba2\u30c7\u30fc\u30bf\u4fdd\u5b58\r\n        $customer = new \\App\\Customer();\r\n        $customer-&gt;name = $request-&gt;name;\r\n        $customer-&gt;email = $request-&gt;email;\r\n        $result = $customer-&gt;save();\r\n\r\n        \/\/ \u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\r\n        if($result &amp;&amp; $request-&gt;hasFile('photos')) {\r\n\r\n            foreach($request-&gt;photos as $photo) { \/\/ \ud83d\udc48 \u9001\u4fe1\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u3072\u3068\u3064\u305a\u3064\u4fdd\u5b58\r\n\r\n                $path = $photo-&gt;store('attachments'); \/\/ \ud83d\udc48 \u300cstorage\/app\/attachments\u300d\u30d5\u30a9\u30eb\u30c0\u306b\u4fdd\u5b58\r\n                $attachment = new \\App\\Attachment();\r\n                $attachment-&gt;parent_id = $customer-&gt;id;\r\n                $attachment-&gt;model = get_class($customer);\r\n                $attachment-&gt;path = $path;\r\n                $attachment-&gt;key = 'photos';\r\n                $attachment-&gt;save();\r\n\r\n            }\r\n\r\n        }\r\n\r\n        return ['result' =&gt; true];\r\n\r\n    }\r\n\r\n    public function test() { \/\/ \ud83d\udc48 \u30c6\u30b9\u30c8\u7528\r\n\r\n        \/\/ \u4fdd\u5b58\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30fc\u30bf\u3068\u9023\u7d50\u3057\u3066\u53d6\u5f97\r\n        $customers = \\App\\Customer::with('attachments')-&gt;get();\r\n\r\n        foreach($customers as $customer) {\r\n\r\n            $attachments = $customer-&gt;attachments; \/\/ \ud83d\udc48 \u5168\u3066\u306e\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\r\n            $photos = $attachments-&gt;filter(function($attachment){ \/\/ \ud83d\udc48 \u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u5199\u771f\u306e\u3082\u306e\u3060\u3051\u53d6\u5f97\r\n\r\n                return ($attachment-&gt;key === 'photos');\r\n\r\n            });\r\n\r\n            echo $customer-&gt;name .'\u3055\u3093\u306e\u5199\u771f\uff08\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\uff09';\r\n\r\n            foreach($photos as $photo) {\r\n\r\n                $path = storage_path('app\/'. $photo-&gt;path); \/\/ \u4fdd\u5b58\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\r\n                dump($path);\r\n\r\n            }\r\n\r\n        }\r\n\r\n    }<\/strong>\r\n\r\n}<\/pre>\n<p>\u5c11\u3057\u30b3\u30fc\u30c9\u304c\u9577\u3044\u306e\u3067\u9806\u306b\u8aac\u660e\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u2460\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a<\/p>\n<p>\u3053\u3053\u3067\u3001\u9867\u5ba2\u30c7\u30fc\u30bf\uff06\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u5199\u771f\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u3053\u304c<strong>\u5b9f\u969b\u306b\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308b\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<\/strong>\uff08\u306a\u304a\u3001\u30d3\u30e5\u30fc\u306f\u6b21\u306e\u9805\u76ee\u3067\u3064\u304f\u308a\u307e\u3059\uff09<\/p>\n<p>\u2461Ajax\u30c7\u30fc\u30bf\u53d7\u4fe1<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001\u9001\u4fe1\u3055\u308c\u305f\u9867\u5ba2\u30c7\u30fc\u30bf\uff08\u4eca\u56de\u306f\u300c\u540d\u524d\u300d\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\uff09\u3068\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u5199\u771f\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u3063\u305f\u3089\u3001\u307e\u305a\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u5185\u5bb9\u304c\u6b63\u3057\u3044\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u5148\u306b\u65b0\u3057\u3044\u9867\u5ba2\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u9867\u5ba2ID\u3092\u5143\u306b\u3057\u3066<code>Attachment<\/code>\u30c7\u30fc\u30bf\u3082\u4f5c\u6210\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u203b\u306a\u304a\u3001\u4fdd\u5b58\u3055\u308c\u308b\u30d5\u30a9\u30eb\u30c0\u306f\u300c<strong>\/storage\/app\/attachments<\/strong>\u300d\u3067\u3001<code>storage<\/code>\u30d5\u30a9\u30eb\u30c0\u306e\u6a29\u9650\u3092<code>777<\/code>\u306b\u3057\u3066\u3044\u308b\u5834\u5408\u7279\u306b\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u2462\u30c6\u30b9\u30c8\u7528<\/p>\n<p>\u3053\u3053\u3067\u306f\u5358\u7d14\u306b<code>customers<\/code>\u3068<code>attachments<\/code>\u3092\u300c<strong>1\uff1a\u591a<\/strong>\u300d\u306e\u95a2\u4fc2\u3067\u7d50\u5408\u3057\u3001\u30c7\u30fc\u30bf\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30eb\u30fc\u30d7\u3067\u3072\u3068\u3064\u305a\u3064<code>customer<\/code>\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u95a2\u9023\u3059\u308b<code>attachments<\/code>\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3001\u3055\u3089\u306b\u30ad\u30fc\u304c\u300c<strong>photos<\/strong>\u300d\u306e\u3082\u306e\u3060\u3051\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u639b\u3051\u3066\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6700\u5f8c\u306b\u30d3\u30e5\u30fc\u3067\u9001\u4fe1\u30d5\u30a9\u30fc\u30e0\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\" class=\"p-3\"&gt;\r\n        &lt;h1 class=\"mb-3\"&gt;Laravel\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u30b5\u30f3\u30d7\u30eb&lt;\/h1&gt;\r\n        &lt;p class=\"bg-light p-3\"&gt;\u9867\u5ba2\u30c7\u30fc\u30bf\u3092\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u5199\u771f\u3092\u4e00\u7dd2\u306b\u4fdd\u5b58\u3059\u308b\u5834\u9762\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002&lt;\/p&gt;\r\n        &lt;div class=\"row\"&gt;\r\n            &lt;div class=\"col-md-6\"&gt;\r\n                &lt;div class=\"form-group\"&gt;\r\n                    &lt;label&gt;\u540d\u524d&lt;\/label&gt;\r\n                    &lt;input type=\"text\" class=\"form-control\" v-model=\"params.name\"&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div class=\"form-group\"&gt;\r\n                    &lt;label&gt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9&lt;\/label&gt;\r\n                    &lt;input type=\"text\" class=\"form-control\" v-model=\"params.email\"&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div class=\"form-group\"&gt;\r\n                    &lt;label&gt;\u5199\u771f\uff08\u8907\u6570\u9078\u3079\u307e\u3059\uff09&lt;\/label&gt;\r\n                    <strong>&lt;!-- \u30d5\u30a1\u30a4\u30eb\u9078\u629e\u90e8\u5206 \u30fb\u30fb\u30fb \u2460 --&gt;<\/strong>\r\n<strong>                    &lt;input<\/strong>\r\n<strong>                        ref=\"photo\"<\/strong>\r\n<strong>                        type=\"file\"<\/strong>\r\n<strong>                        class=\"form-control\"<\/strong>\r\n<strong>                        accept=\"image\/gif,image\/jpeg,image\/png\"<\/strong>\r\n<strong>                        @change=\"onFileChange\"<\/strong>\r\n<strong>                        multiple&gt;<\/strong>\r\n                &lt;\/div&gt;\r\n                &lt;div class=\"text-right\"&gt;\r\n                    &lt;button type=\"button\" class=\"btn btn-primary\" @click=\"onSubmit\"&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                params: {\r\n                    name: '',\r\n                    email: ''\r\n                },\r\n                photos: []\r\n            },\r\n            methods: {\r\n                <strong>onFileChange(e) {<\/strong>\r\n\r\n<strong>                    this.photos = e.target.files; \/\/ \u30d5\u30a1\u30a4\u30eb\u3092\u5909\u6570\u306b\u683c\u7d0d<\/strong>\r\n\r\n<strong>                },<\/strong>\r\n                onSubmit() {\r\n\r\n                    \/\/ \u9001\u4fe1\u30c7\u30fc\u30bf\u3092\u7528\u610f\u3059\u308b \u30fb\u30fb\u30fb \u2461\r\n                    <strong>let formData = new FormData();<\/strong>\r\n<strong>                    formData.append('name', this.params.name);<\/strong>\r\n<strong>                    formData.append('email', this.params.email);<\/strong>\r\n\r\n<strong>                    for(let photo of this.photos) {<\/strong>\r\n\r\n<strong>                        formData.append('photos[]', photo);<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n                    axios.post('\/ajax\/customer', formData)\r\n                        .then(response =&gt; {\r\n\r\n                            if(response.data.result) {\r\n\r\n                                alert('\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6210\u529f\uff01');\r\n\r\n                                \/\/ \u5165\u529b\u30c7\u30fc\u30bf\u3092\u521d\u671f\u5316\r\n                                this.params = {\r\n                                    name: '',\r\n                                    email: ''\r\n                                };\r\n                                this.$refs['photo'].value = '';\r\n\r\n                            }\r\n\r\n                        })\r\n                        .catch(error =&gt; {\r\n\r\n                            \/\/ \u3053\u3053\u3067\u30a8\u30e9\u30fc\u51e6\u7406\r\n                            console.log(error);\r\n\r\n                        });\r\n\r\n                }\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u7279\u306b\u91cd\u8981\u306a\u306e\u304c\uff12\u3064\u3067\u3059\u3002<\/p>\n<p>\u2460\u30d5\u30a1\u30a4\u30eb\u9078\u629e\u90e8\u5206<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3059\u308b<code>input<\/code>\u30bf\u30b0\u3067\u3059\u304c\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u9078\u629e\u3055\u308c\u305f\u6642\u70b9\u3067<code>onFileChange()<\/code>\u304c\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>onFileChange()<\/code>\u306e\u4e2d\u3067\u306f\u9078\u629e\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u30c7\u30fc\u30bf\u3092<code>Vue<\/code>\u306e<code>photos<\/code>\u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u2461\u9001\u4fe1\u30c7\u30fc\u30bf\u3092\u7528\u610f\u3059\u308b<\/p>\n<p>\u300c<strong>\u9001\u4fe1\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3068\u304d\u306b<code>Ajax\u9001\u4fe1<\/code>\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30fc\u30c9\u3092\u898b\u3066\u3044\u305f\u3060\u304f\u3068\u308f\u304b\u308b\u3068\u304a\u308a\u3001<code>axios<\/code>\u306e\u3088\u304f\u898b\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u8a2d\u5b9a\u3068\u306f\u9055\u3044\u3001<code>FormData<\/code>\u3092\u3064\u304b\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001<strong>\u30d5\u30a1\u30a4\u30eb\u3092\u9001\u4fe1\u3059\u308b\u5834\u5408\u306f\u901a\u5e38\u306e\u9001\u4fe1\u65b9\u6cd5\u3067\u306f\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/strong><\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<br \/>\n\u30d6\u30e9\u30a6\u30b6\u3067\u300c<strong>http:\/\/*****\/customer\/create<\/strong>\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7152\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_3.png\" alt=\"\" width=\"495\" height=\"537\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_3.png 495w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_3-277x300.png 277w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/p>\n<p>\u753b\u50cf\u306e\u3088\u3046\u306b\u300c\u540d\u524d\u300d\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u3092\u5165\u529b\u3057\u3001\u753b\u50cf\u3092\u9078\u629e\u3057\u3066\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306a\u30a2\u30e9\u30fc\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7153\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_4.png\" alt=\"\" width=\"443\" height=\"131\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_4.png 443w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_4-300x89.png 300w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/p>\n<p>\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7155\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_5.png\" alt=\"\" width=\"606\" height=\"269\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_5.png 606w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_5-300x133.png 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7154\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_6.png\" alt=\"\" width=\"640\" height=\"233\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_6.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_6-300x109.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u30c7\u30fc\u30bf\u306f\u4e0a\u624b\u304f\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6b21\u306f<code>storage<\/code>\u30d5\u30a9\u30eb\u30c0\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7156\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_8.png\" alt=\"\" width=\"496\" height=\"173\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_8.png 496w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_upload_8-300x105.png 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/p>\n<p>\u3053\u3061\u3089\u3082\u4e0a\u624b\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u307e\u3051\uff1a\u30c7\u30fc\u30bf\u524a\u9664\u3055\u308c\u305f\u3089\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u3092\u81ea\u52d5\u3067\u524a\u9664\u3059\u308b<\/h1>\n<p>\u8907\u96d1\u306b\u306a\u308b\u306e\u3067\u672c\u7de8\u306b\u306f\u542b\u3081\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u4f8b\u3048\u3070<code>customers<\/code>\u304b\u3089\u3042\u308b\u30c7\u30fc\u30bf\u304c\u524a\u9664\u3055\u308c\u305f\u3089\u3001<strong>\u95a2\u9023\u3059\u308b<code>attachments<\/code>\u306e\u30c7\u30fc\u30bf\u3001\u305d\u3057\u3066\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u65b9\u6cd5<\/strong>\u3092\u300c\u304a\u307e\u3051\u300d\u3068\u3057\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u30e2\u30c7\u30eb\u306e\u30c7\u30fc\u30bf\u304c\u524a\u9664\u3055\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308b<code>CustomerDeleted<\/code>\u3068\u3044\u3046\u30a4\u30d9\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:event CustomerDeleted<\/strong><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u305f\u3089\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function __construct(Customer $customer)\r\n{\r\n<strong>    foreach($customer-&gt;attachments as $attachment) {<\/strong>\r\n\r\n<strong>        \\Storage::delete($attachment-&gt;path); \/\/ \ud83d\udc48 \u30d5\u30a1\u30a4\u30eb\u524a\u9664<\/strong>\r\n<strong>        $attachment-&gt;delete(); \/\/ \ud83d\udc48 attachment\u30c7\u30fc\u30bf\u524a\u9664<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h2>\u30e2\u30c7\u30eb\u306b\u30a4\u30d9\u30f3\u30c8\u3092\u30bb\u30c3\u30c8\u3059\u308b<\/h2>\n<p>\u6b21\u306b\u3001<code>CustomerDeleted<\/code>\u304c\u30c7\u30fc\u30bf\u524a\u9664\u3055\u308c\u305f\u3068\u304d\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b<code>Customer<\/code>\u30e2\u30c7\u30eb\u306b\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u90e8\u5206\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\n<strong>use App\\Events\\CustomerDeleted; \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Customer extends Model\r\n{\r\n    <strong>\/\/ \ud83d\udc47 \u8ffd\u52a0<\/strong>\r\n<strong>    protected $dispatchesEvents = [<\/strong>\r\n<strong>        'deleted' =&gt; CustomerDeleted::class<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n    \/\/ \u7701\u7565\r\n}<\/pre>\n<p>\u3053\u308c\u3067\u6b21\u306e\u3088\u3046\u306a\u5834\u5408\u3001\u81ea\u52d5\u7684\u306b<strong>\u95a2\u9023\u3059\u308b<code>attachments<\/code>\u3082\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u3082\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<pre><strong>$customer = \\App\\Customer::first();<\/strong>\r\n<strong>$customer-&gt;delete(); \/\/ \ud83d\udc48 \u81ea\u52d5\u3067attachments, \u30d5\u30a1\u30a4\u30eb\u304c\u524a\u9664\u3055\u308c\u308b<\/strong><\/pre>\n<h1>\u6559\u6750\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u6559\u6750\u30d5\u30a1\u30a4\u30eb\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=7158&amp;tmstv=1777531833\" rel=\"nofollow\" id=\"download-link-7158\" data-redirect=\"false\" >\n\t\u3010Laravel\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd<\/a>\n\n<p>\u203b\u305f\u3060\u3057\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306a\u3069\u306f\u3054\u81ea\u8eab\u3067\u5b9f\u884c\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\u4eca\u56de\u306f<code>Laravel<\/code>\u3092\u4f7f\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306f\u3001\u3088\u304f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u69d8\u304b\u3089\u3082\u3054\u4f9d\u983c\u3092\u53d7\u3051\u308b\u6a5f\u80fd\u306a\u306e\u3067\u899a\u3048\u3066\u304a\u304f\u3068\u3001\u304d\u3063\u3068\u5f8c\u3067\u697d\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3088\ud83d\udc4d<\/p>\n<p>\u307e\u305f\u3001\u4eca\u56de\u306f<code>attachments<\/code>\u30c6\u30fc\u30d6\u30eb\u306f\u3069\u3093\u306a\u30e2\u30c7\u30eb\u304b\u3089\u3067\u3082\u9023\u643a\u3067\u304d\u308b\u5f62\u306b\u3057\u307e\u3057\u305f\u306e\u3067\u3001<code>customers<\/code>\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3067\u306a\u304f\u305d\u306e\u4ed6\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u3082\u4f7f\u3044\u3084\u3059\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3467 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u5916\u51fa\u81ea\u7c9b\u306a\u306e\u3067\u3001\u5c0f\u8aac\u306e\u4e3b\u4eba\u516c\u3092<br \/>\n\u81ea\u5206\u306b\u7f6e\u304d\u63db\u3048\u308b\u64ec\u4f3cVR\u8aad\u66f8\u3057\u3066\u3044\u307e\u3059\ud83d\ude02\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5300\u8a18\u4e8b\u3092\u7a81\u7834\u3057\u305f\u306e\u3067\u904e\u53bb\u306e\u5185\u5bb9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 \u3059\u308b\u3068\u3001\u300c\u3042\u308c\u3001\u8a18\u4e8b\u306b\u3057\u3066\u306a\u304b\u3063\u305f\u3063\u3051\u2753\u2753\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u305d\u308c\u306f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=7148\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u3064\u304f\u308b\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":7165,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[137],"class_list":["post-7148","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-137"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7148","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=7148"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7148\/revisions"}],"predecessor-version":[{"id":10024,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7148\/revisions\/10024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/7165"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}