{"id":768,"date":"2018-07-26T03:54:21","date_gmt":"2018-07-25T18:54:21","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=768"},"modified":"2018-07-26T03:54:21","modified_gmt":"2018-07-25T18:54:21","slug":"%e5%85%a868%e7%a8%ae%e9%a1%9e%ef%bc%81laravel-5-6%e3%81%aeartisan%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89%e3%81%be%e3%81%a8%e3%82%81","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=768","title":{"rendered":"\u516868\u7a2e\u985e\uff01Laravel 5.6\u306eartisan\u30b3\u30de\u30f3\u30c9\u307e\u3068\u3081"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u6700\u8fd1\u306f\u300cLaravel\u306e\u4e3b\u8981\u306a\u6a5f\u80fd\u3092\u518d\u30c1\u30a7\u30c3\u30af\u300d\u3059\u308b\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306b\u3088\u3063\u3066\u898b\u9003\u3057\u3066\u3044\u305f\u6a5f\u80fd\u3084\u3001\u3088\u308a\u77ed\u3044\u30b3\u30fc\u30c9\u3067\u306e\u5b9f\u88c5\u65b9\u6cd5\u3092\u767a\u898b\u3059\u308b\u306a\u3069\u3068\u3044\u3063\u305f\u591a\u304f\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u611f\u3058\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u6b21\u306f\u4f55\u3092\u5b66\u3073\u76f4\u3059\u3079\u304d\u304b\u3092\u8003\u3048\u3066\u3044\u305f\u3068\u304d\u306b\u3075\u3068\u300cLaravel\u3092\u30e1\u30a4\u30f3\u3067\u4f7f\u3044\u59cb\u3081\u305f\u7406\u7531\u306e\u3046\u3061\u306e\u3072\u3068\u3064\u300d\u3001<strong>artisan\u30b3\u30de\u30f3\u30c9<\/strong>\uff08\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5b9f\u884c\u3059\u308bLaravel\u5c02\u7528\u306e\u547d\u4ee4\uff09\u306f\u3069\u3046\u3060\u308d\u3046\u3001\u3068\u3044\u3046\u8003\u3048\u304c\u982d\u306b\u6d6e\u304b\u3073\u307e\u3057\u305f\u3002<\/p>\n<p>\u5143\u3005\u79c1\u306fCakePHP\u3092\u30e1\u30a4\u30f3\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u5f53\u6642\u306eCakePHP\u306f\u4f55\u5ea6\u3082\u540c\u3058SQL\u3092\u767a\u884c\u3057\u305f\u308a\u3001\u3068\u306b\u304b\u304f\u914d\u5217\u3067\u5168\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u305f\u3081\u53ef\u8aad\u6027\u304c\u60aa\u304b\u3063\u305f\u308a\u3057\u3066\u3042\u307e\u308a\u597d\u304d\u306a\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u305d\u3093\u306a\u4e2d\u3001\u3042\u308b\u958b\u767a\u3067Laravel\u306b\u51fa\u4f1a\u3044\u3001\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u306b\u611f\u9298\u3092\u53d7\u3051\u3001\u305d\u3057\u3066artisan\u30b3\u30de\u30f3\u30c9\u3068\u3044\u3046\u300c\u5927\u5e45\u306a\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u300d\u3092\u77e5\u3063\u305f\u7d50\u679c\u3001\u30e1\u30a4\u30f3\u3068\u3057\u3066\u958b\u767a\u3067\u4f7f\u3046\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u5909\u66f4\u3059\u308b\u6c7a\u65ad\u3092\u3057\u305f\u3068\u3044\u3046\u7d4c\u7def\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u305d\u3093\u306a\u300cartisan\u30b3\u30de\u30f3\u30c9\u300d\u306e\u5168\u5b9f\u4f8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u30b5\u30fc\u30d3\u30b9\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08clear-compiled\uff09<\/h1>\n<pre><strong>php artisan clear-compiled<\/strong><\/pre>\n<p>Laravel\u306f\u3001\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3084ServiceProvider\u3078\u306e\u30d1\u30b9\u306a\u3069\u304c\u66f8\u304b\u308c\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u300c<strong>bootstrap\/cache<\/strong>\u300d\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b\u306e\u304c\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u5f79\u76ee\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u7528\u9014\u3068\u3057\u3066\u306fcomposer\u3067Laravel\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\uff08\u4f55\u304b\u306e\u5f71\u97ff\u3067\uff09\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u5408\u306a\u3069\u306b\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u305f\u5f8c\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h1>\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u30fb\u30e2\u30fc\u30c9\u306b\u3059\u308b\uff08down\uff09<\/h1>\n<pre><strong>php artisan down<\/strong><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u901a\u5e38\u30da\u30fc\u30b8\u306e\u4ee3\u308f\u308a\u306b\u300c<strong>Be right back.\uff08\u3059\u3050\u623b\u308a\u307e\u3059\uff09<\/strong>\u300d\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u5168\u30da\u30fc\u30b8\u3067\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-774\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/be_right_back.png\" alt=\"\" width=\"260\" height=\"65\" \/><\/p>\n<h2>\u300cBe right back.\u300d\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5909\u66f4\u3059\u308b\uff08&#8211;message\uff09<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u30fb\u30e2\u30fc\u30c9\u6642\u306b\u8868\u793a\u3055\u308c\u308b\u300cBe right back.\u300d\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u300c\u73fe\u5728\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u4e2d\u3067\u3059\u3002\u300d\u3068\u5909\u66f4\u3059\u308b\u306b\u306f\u300c<strong>&#8211;message<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>php artisan down <strong>--message=\"\u73fe\u5728\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u4e2d\u3067\u3059\"<\/strong><\/pre>\n<p><strong>\u203b\u6ce8\u610f<\/strong><\/p>\n<p>\u305f\u3060\u3057\u3001\u3053\u3053\u3067\u8a2d\u5b9a\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u306f\u4ee5\u4e0b\u306e\u30d1\u30b9\u306b503\u5c02\u7528\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3001\u3055\u3089\u306bstorage\u30d5\u30a9\u30eb\u30c0\u304b\u3089\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3080\u30b3\u30fc\u30c9\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001<span style=\"text-decoration: underline;\">\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u8868\u793a\u5909\u66f4\u3067\u304d\u307e\u305b\u3093<\/span>\uff09<\/p>\n<pre><strong>resources\/views\/erros\/503.blade.php<\/strong><\/pre>\n<p>\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30b3\u30fc\u30c9\u4f8b\uff09<\/p>\n<pre>@extends('errors::layout')\r\n\r\n@section('title', 'Service Unavailable')\r\n\r\n@section('message', <strong>json_decode(file_get_contents(storage_path('framework\/down')), true)['message']<\/strong>)<\/pre>\n<p>\u3053\u308c\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6307\u5b9a\u3059\u308b\u3068\u305d\u306e\u90fd\u5ea6\u5909\u66f4\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-776\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/under_maintenance.png\" alt=\"\" width=\"484\" height=\"82\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/under_maintenance.png 484w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/under_maintenance-300x51.png 300w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><\/p>\n<p>\uff08\u3061\u306a\u307f\u306b\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u8868\u793a\u306e\u5909\u66f4\u3092\u3057\u3066\u3082\u3044\u3044\u306e\u3067\u306f\u30fb\u30fb\u30fb\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u81ea\u7531\u5ea6\u3092\u512a\u5148\u3055\u305b\u3066\u306e\u3053\u3068\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff09<\/p>\n<h2>Retry-After\u3092\u9001\u4fe1\u3059\u308b\uff08&#8211;retry\uff09<\/h2>\n<p>\u3082\u3057\u3001\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u306e\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u3068\u304d\u306b\u300c<strong>Retry-After<\/strong>\u300d\u30d8\u30c3\u30c0\u30fc\u3092\u9001\u4fe1\u3057\u305f\u3044\u5834\u5408\u306f\u300c<strong>&#8211;retry<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>php artisan down <strong>--retry=60<\/strong><\/pre>\n<p>\u203b\u3061\u306a\u307f\u306b\u3001Retry-After\u306f\u3001\u300c\u3069\u306e\u3050\u3089\u3044\uff08\u79d2\u6570\uff09\u5f85\u3063\u305f\u5f8c\u306b\u518d\u5b9f\u884c\u3059\u308b\u304b\uff1f\uff1f\u300d\u3092\u6307\u5b9a\u3059\u308bHTTP\u30d8\u30c3\u30c0\u30fc\u3067\u3059\u3002\u8a73\u3057\u304f\u306f<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Retry-After\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\uff08\u82f1\u8a9e\u30da\u30fc\u30b8\uff09<\/p>\n<h2>\u7279\u5b9a\u306eIP\u30a2\u30c9\u30ec\u30b9\u306f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\uff08&#8211;allow\uff09<\/h2>\n<p>\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u30fb\u30e2\u30fc\u30c9\u306f\u305d\u306e\u307e\u307e\u3067\u306f\u5168\u30e6\u30fc\u30b6\u30fc\u3092\u30b5\u30a4\u30c8\u304b\u3089\u906e\u65ad\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u306a\u308b\u305f\u3081\u3001\u7d50\u679c\u3068\u3057\u3066<strong>\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u3092\u3059\u308b\u4eba\uff08\u958b\u767a\u8005\uff09\u3067\u3055\u3048\u901a\u5e38\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u305d\u3053\u3067\u3001\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u306e\u304c\u300c<strong>&#8211;allow<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre>php artisan down <strong>--allow=127.0.0.1<\/strong><\/pre>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067<strong>\u3042\u306a\u305f\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u3068\u3001\u3042\u306a\u305f\u3060\u3051\u306f\u901a\u5e38\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p>\u306a\u304a\u3001\u8907\u6570\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3059\u308b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan down <strong>--allow=127.0.0.1 --allow=127.0.0.2<\/strong><\/pre>\n<h1>\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u30fb\u30e2\u30fc\u30c9\u3092\u7d42\u4e86\u3059\u308b\uff08up\uff09<\/h1>\n<pre><strong>php artisan up<\/strong><\/pre>\n<p>\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u30fb\u30e2\u30fc\u30c9\u3092\u629c\u3051\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<h1>\u5b9f\u884c\u74b0\u5883\u3092\u78ba\u8a8d\u3059\u308b\uff08env\uff09<\/h1>\n<pre><strong>php artisan env<\/strong><\/pre>\n<p>Laravel\u306f\u3001\u300c.env\u300d\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u300cAPP_ENV\u300d\u3068\u3044\u3046<strong>\u5b9f\u884c\u74b0\u5883\u3092\u6307\u5b9a\u3059\u308b\u5834\u6240\u304c\u3042\u308a\u307e\u3059\u3002<\/strong>\uff08\u3064\u307e\u308a\u300clocal\u300d\u3001\u300cproduction\u300d\u300cstaging\u300d\u306a\u3069\u3092\u8a18\u8ff0\u3057\u307e\u3059\uff09<\/p>\n<pre><strong>APP_ENV<\/strong>=local<\/pre>\n<p>\u300cphp artisan env\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u3053\u306e\u300cAPP_ENV\u300d\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>\u30b3\u30de\u30f3\u30c9\u306e\u30d8\u30eb\u30d7\u3092\u8868\u793a\u3059\u308b\uff08help\uff09<\/h1>\n<pre><strong>php artisan help (\u30b3\u30de\u30f3\u30c9)<\/strong><\/pre>\n<p>artisan\u30b3\u30de\u30f3\u30c9\u306e\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u300cdown\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan help down<\/strong><\/pre>\n<p>\u305f\u3060\u3057\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300c<strong>-h<\/strong>\u300d\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3082\u540c\u3058\u5185\u5bb9\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3082\u3057\u304b\u3059\u308b\u3068\u3001\u3053\u3061\u3089\u306e\u65b9\u304c\u76f4\u611f\u7684\u306b\u4f7f\u3048\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre>php artisan down <strong>-h<\/strong><\/pre>\n<h1>\u540d\u8a00\u3092\u8868\u793a\u3059\u308b\uff08inspire\uff09<\/h1>\n<pre><strong>php artisan inspire<\/strong><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30de\u30eb\u30af\u30b9\u30fb\u30a2\u30f3\u30c8\u30cb\u30a6\u30b9\u306e\u540d\u8a00\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u304a\u904a\u3073\u7684\u306a\u30b3\u30de\u30f3\u30c9\u3067\u3059\u306d\uff09<\/p>\n<blockquote><p>Very little is needed to make a happy life.\uff08\u5e78\u798f\u306a\u4eba\u751f\u306b\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3082\u306e\u306f\u307b\u3068\u3093\u3069\u306a\u3044\uff09<\/p><\/blockquote>\n<p>\u305f\u3060\u3001\u5b9f\u969b\u306b\u306f\u3053\u306e\u540d\u8a00\u306b\u306f\u4ee5\u4e0b\u306e\u6587\u7ae0\u304c\u7d9a\u304f\u3088\u3046\u3067\u3059\u3002<\/p>\n<blockquote><p>it is all within yourself, in your way of thinking.\uff08\u5168\u3066\u306f\u3042\u306a\u305f\u306e\u4e2d\u306b\u3001\u305d\u3057\u3066\u3042\u306a\u305f\u306e\u8003\u3048\u65b9\u306e\u4e2d\u306b\u3042\u308b\uff09<\/p><\/blockquote>\n<p>\u958b\u767a\u8005\u304b\u3089\u306e\u6211\u3005\u3078\u306e\u30a8\u30fc\u30eb\u3067\u3059\u306d\u3002^^<\/p>\n<h1>DB\u30c6\u30fc\u30d6\u30eb\u304b\u3089Seed\u3092\u4f5c\u308b\uff08iseed\uff09<\/h1>\n<pre><strong>php artisan iseed (\u30c6\u30fc\u30d6\u30eb\u540d)<\/strong><\/pre>\n<p>\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u308bDB\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066Seed\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u3082\u3057\u3059\u3067\u306bSeed\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u4e0a\u66f8\u304d\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u805e\u304b\u308c\u308b\u306e\u3067\u3001\u300cyes\u300d\u3082\u3057\u304f\u306f\u300cno\u300d\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<blockquote><p>File ItemsTableSeeder.php already exist. Do you wish to override it? [yes|no]<\/p><\/blockquote>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u306fSeed\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u300c<strong>database\/seeds\/DatabaseSeeder.php<\/strong>\u300d\u306b\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>artisan\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\uff08list\uff09<\/h1>\n<pre><strong>php artisan list<\/strong><\/pre>\n<p>artisan\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001<strong>\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u306b\u300cphp artisan\u300d\u3068\u3059\u308b\u3060\u3051\u3067\u540c\u3058\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u3053\u3061\u3089\u306e\u4f7f\u7528\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/strong><\/p>\n<pre><strong>php artisan<\/strong><\/pre>\n<h1>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\uff08migrate\uff09<\/h1>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<h2 id=\"database_option\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;database\uff09<\/h2>\n<pre>php artisan migrate <strong>--database=(\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u540d)<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u6307\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u6ce8\u610f\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u306f\u3001<strong>\u6307\u5b9a\u3059\u308b\u306e\u306f\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3067\u306f\u306a\u304f\u300c\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u540d\u300d\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/strong>\u3064\u307e\u308a\u3001\u6307\u5b9a\u3067\u304d\u308b\u306e\u306f\u300c<strong>config\/database.php<\/strong>\u300d\u5185\u306e\u300cconnections\u300d\u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u540d\u524d\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\uff08\u521d\u671f\u3067\u306f\u300csqlite\u300d\u3084\u300cmysql\u300d\u306a\u3069\u304c\u3042\u308a\u307e\u3059\uff09<\/p>\n<h2 id=\"force_option\">\u5b9f\u884c\u78ba\u8a8d\u3092\u7701\u7565\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<pre>php artisan migrate <strong>--force<\/strong><\/pre>\n<p>\u3082\u3057\u3001\u5b9f\u884c\u74b0\u5883\u304c\u300cproduction\u300d\uff08\u2190\u672c\u756a\u74b0\u5883\uff09\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u5b89\u5168\u306e\u305f\u3081artisan\u30b3\u30de\u30f3\u30c9\u306f<strong>\u300c\u672c\u5f53\u306b\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u3057\u3066\u3082\u5927\u4e08\u592b\u3067\u3059\u304b\uff1f\u300d\u3068\u78ba\u8a8d\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-780\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/migration_confirmation.png\" alt=\"\" width=\"500\" height=\"24\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/migration_confirmation.png 500w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/migration_confirmation-300x14.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>\u300c<strong>&#8211;force<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u3053\u306e\u78ba\u8a8d\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u3084\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3067\u306f\u610f\u5473\u304c\u3042\u308a\u307e\u305b\u3093\uff09<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u5b9f\u884c\u74b0\u5883\u306f\u300c.env\u300d\u30d5\u30a1\u30a4\u30eb\u3067\u5909\u66f4\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre><strong>APP_ENV=production<\/strong><\/pre>\n<h2 id=\"migration_path\">\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;path\uff09<\/h2>\n<pre>php artisan migrate <strong>--path=(\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9)<\/strong><\/pre>\n<p>Laravel\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a9\u30eb\u30c0\u306f\u300c<strong>database\/migrations<\/strong>\u300d\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u4f55\u304b\u306e\u7406\u7531\u3067\u5225\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u300c<strong>&#8211;path<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3053\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan migrate <strong>--path=database\/migrations_2<\/strong><\/pre>\n<h2 id=\"migration_realpath\">\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a9\u30eb\u30c0\u3092realpath\u3067\u6307\u5b9a\u3059\u308b\uff08&#8211;realpath\uff09<\/h2>\n<pre><strong>php artisan migrate --path=(\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a9\u30eb\u30c0) --realpath<\/strong><\/pre>\n<p>\u300c&#8211;path\u300d\u3067\u6307\u5b9a\u3059\u308b\u30d1\u30b9\u3092realpath\u3067\u6307\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002realpath\u306b\u3064\u3044\u3066\u306f<a href=\"http:\/\/php.net\/manual\/ja\/function.realpath.php\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"migration_pretend\">\u4eca\u304b\u3089\u5b9f\u884c\u3055\u308c\u308b\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306eSQL\u3092\u78ba\u8a8d\u3059\u308b\uff08&#8211;pretend\uff09<\/h2>\n<pre>php artisan migrate <strong>--pretend<\/strong><\/pre>\n<p>\u300c&#8211;pretend\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068<strong>\u672a\u5b9f\u884c\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u305f\u3089\u3069\u3093\u306aSQL\u6587\u304c\u5b9f\u884c\u3055\u308c\u308b\u304b<\/strong>\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u203b\u3064\u307e\u308a\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308b\u3068\u5b9f\u969b\u306bSQL\u6587\u304c\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\u78ba\u8a8d\u3067\u304d\u308b\u3060\u3051\u3067\u3059\u3002<\/strong><\/p>\n<h2 id=\"migration_seed\">Seed\u3082\u540c\u6642\u306b\u5b9f\u884c\u3059\u308b\uff08&#8211;seed\uff09<\/h2>\n<pre><strong>php artisan migrate --seed<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3064\u3064Seed\u3082\u5b9f\u884c\uff08\u521d\u671f\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\uff09\u3057\u305f\u3044\u5834\u5408\u306f\u300c<strong>&#8211;seed<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u756a\u53f7\u3092\u5897\u3084\u3057\u306a\u304c\u3089\u5b9f\u884c\u3059\u308b\uff08&#8211;step\uff09<\/h2>\n<pre><strong>php artisan migrate --step<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306f\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u6c17\u306b\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u305d\u306e\u300c\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u756a\u53f7\u300d\u306f\u5168\u3066\u540c\u3058\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3059\u308b\u3068\u540c\u6642\u306b\u5b9f\u884c\u3057\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306f\u5168\u3066\u5143\u901a\u308a\u306b\u306a\u308b\uff09<\/p>\n<p>\u3057\u304b\u3057\u300c&#8211;step\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u308b\u305f\u3073\u306b\u300c\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u756a\u53f7\u300d\u304c\u5897\u3084\u3055\u308c\u308b\u305f\u3081\u3001\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4e8b\u304c\u8d77\u3053\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u300c<strong>&#8211;step<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u5b9f\u884c<\/li>\n<li>\u5168\u90e8\u3067\uff15\u3064\u304c\u5b9f\u884c\u3055\u308c\u305f<\/li>\n<li>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3082\u3068\u306b\u623b\u3059\u3088\u3046\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c<\/li>\n<li>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3055\u308c\u308b\u306e\u306f<strong>\u6700\u5f8c\u306b\u5b9f\u884c\u3057\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u307f<\/strong><\/li>\n<\/ol>\n<h1>JavaScript\u3068CSS\u306e\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c9\u3092\u5909\u66f4\u3059\u308b\uff08preset\uff09<\/h1>\n<pre><strong>php artisan preset (none, bootstrap, vue, react\u306e\u3069\u308c\u304b)<\/strong><\/pre>\n<p>Laravel\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u6642\u70b9\u3067Vue\u3068Bootstrap\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u5fc5\u9808\u3067\u306f\u306a\u304f\u3001\u4f8b\u3048\u3070\u300creact.js\u300d\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan preset <strong>react<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u6307\u5b9a\u3067\u304d\u308b\u30bf\u30a4\u30d7\u306f\u4ee5\u4e0b\u306e\uff14\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li><strong>none\uff08\u30b9\u30ad\u30e3\u30d5\u30a9\u30fc\u30eb\u30c9\u3092\u524a\u9664\u3057\u307e\u3059\uff09<\/strong><\/li>\n<li><strong>bootstrap<\/strong><\/li>\n<li><strong>vue<\/strong><\/li>\n<li><strong>react<\/strong><\/li>\n<\/ul>\n<p>\u203b\u305f\u3060\u3057\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3060\u3051\u3067\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u306e\u3067\u300cnpm install &amp;&amp; npm run dev\u300d\u306a\u3069\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u3092\u5b9f\u884c\u3059\u308b\uff08serve\uff09<\/h1>\n<pre><strong>php artisan serve<\/strong><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068PHP\u306e\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5b9f\u884c\u5f8c\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3067\u307e\u3059\u306e\u3067\u3001\u300chttp:\/\/127.0.0.1:8000\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u7c21\u5358\u306b\u30da\u30fc\u30b8\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n<blockquote><p>Laravel development server started: &lt;http:\/\/127.0.0.1:8000&gt;<\/p><\/blockquote>\n<p>\u203b\u3061\u306a\u307f\u306b\u7d42\u4e86\u3059\u308b\u5834\u5408\u306fctrl+c\u3092\u30bf\u30a4\u30d7\u3057\u307e\u3059\u3002\uff08Ubuntu\u306e\u5834\u5408\uff09<\/p>\n<blockquote>\n<h2>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u3092\u5b9f\u884c\u3059\u308b\u30db\u30b9\u30c8\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;host\uff09<\/h2>\n<\/blockquote>\n<pre>php artisan serve <strong>--host=127.0.0.2<\/strong><\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u30db\u30b9\u30c8\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u300c&#8211;host\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u307e\u3059\u3002\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u300c127.0.0.1\u300d\u3067\u3059\uff09<\/p>\n<h2>\u30d3\u30eb\u30c8\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306e\u30dd\u30fc\u30c8\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;port\uff09<\/h2>\n<pre>php artisan serve <strong>--port=8001<\/strong><\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u30dd\u30fc\u30c8\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u306f\u300c&#8211;port\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u307e\u3059\u3002\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u306f8000\u3067\u3059\u3002\uff09<\/p>\n<h1>\u5bfe\u8a71\u7684\u74b0\u5883\u3092\u30b9\u30bf\u30fc\u30c8\u3059\u308b\uff08tinker\uff09<\/h1>\n<pre><strong>php artisan tinker<\/strong><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u4e0a\u3067PHP\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u5bfe\u8a71\u7684\u306a\u74b0\u5883\uff08REPL\uff09\u3092\u30b9\u30bf\u30fc\u30c8\u3055\u305b\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u203b\u7d42\u4e86\u3059\u308b\u5834\u5408\u306fctrl+c\u3092\u30bf\u30a4\u30d7\u3057\u307e\u3059\u3002\uff08Ubuntu\u306e\u5834\u5408\uff09<\/p>\n<h2>\u5bfe\u8a71\u7684\u74b0\u5883\u306b\u7279\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3059\u308b<\/h2>\n<p>\u3082\u3057Tinker\u3092\u4f7f\u3046\u5834\u5408\u3067\u3001\u4e8b\u524d\u306b\u7279\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u3092include()\u3057\u3066\u7f6e\u304d\u305f\u3044\u5834\u5408\u306f\u5909\u6570\u3068\u3057\u3066\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>php artisan tinker <strong>\/home\/php-dev\/laravel56\/test.php<\/strong><\/pre>\n<p>\u3055\u3089\u306b\u3001\u8907\u6570\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7d9a\u3051\u3066\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan tinker <strong>\/home\/php-dev\/laravel56\/test.php \/home\/php-dev\/laravel56\/test2.php<\/strong><\/pre>\n<h1>app\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\uff08app:name\uff09<\/h1>\n<pre><strong>php artisan app:name (\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9)<\/strong><\/pre>\n<p>Laravel\u306eapp\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u521d\u671f\u5024\u3067\u300cApp\u300d\u3068\u3044\u3046\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u304c\u3064\u3051\u3089\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3048\u3070\u3053\u306e\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u300cMyApp\u300d\u306b\u5909\u66f4\u3059\u308b\u5834\u5408\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan app:name <strong>MyApp<\/strong><\/pre>\n<p><strong>\u203b\u6ce8\u610f<\/strong><\/p>\n<p>\u305f\u3060\u3057\u3001<strong>\u7d76\u5bfe\u306b\u7a7a\u767d\u3067\u5b9f\u884c\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/strong>\u5909\u66f4\u524d\u306e\u5834\u6240\u304c\u5206\u304b\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u975e\u5e38\u306b\u5143\u306b\u623b\u3057\u306b\u304f\u304f\u306a\u3063\u3066\u3057\u307e\u3057\u307e\u3059\u3002<\/p>\n<h1>\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\uff08make:auth\uff09<\/h1>\n<pre><strong>php artisan make:auth<\/strong><\/pre>\n<p>Laravel\u306f\u521d\u671f\u72b6\u614b\u3067\u306f\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306f\u4f7f\u3048\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3053\u3068\u3067\u7c21\u5358\u306b\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u203b\u6ce8\u610f<\/strong><\/p>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3060\u3051\u3067\u306f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u3060\u3051\u3067\u3059\u3002\u3064\u307e\u308a\u3001<strong>\u300cphp artisan migrate\u300d\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/strong><\/p>\n<h2>\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306e\u30d3\u30e5\u30fc\u3060\u3051\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;views\uff09<\/h2>\n<p>\u300c&#8211;views\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3048\u3070\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306e\u4e2d\u304b\u3089\u30d3\u30e5\u30fc\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff09\u3060\u3051\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u4e0a\u66f8\u304d\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<p>\u91cd\u8907\u3057\u3066\u300cmake:auth\u300d\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u300c\u4e0a\u66f8\u304d\u3057\u3066\u3044\u3044\u3067\u3059\u304b\uff1f\u300d\u3068\u3044\u3046\u78ba\u8a8d\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u300c&#8211;force\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3053\u306e\u78ba\u8a8d\u3092\u5168\u3066\u7701\u7565\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>Seed\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:seeder\uff09<\/h1>\n<pre><strong>php artisan make:seeder (Seed\u540d)<\/strong><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u521d\u671f\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306eSeed\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u521d\u671f\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan make:seeder <strong>UsersTableSeeder<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u300cdatabase\/seeds\u300d\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u300cUserTableSeeder.php\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3067\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass UsersTableSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Run the database seeds.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n<strong>        for($i = 1 ; $i &lt;= 3 ; $i++) {<\/strong>\r\n\r\n<strong>            \\App\\User::create([<\/strong>\r\n<strong>                'name' =&gt; '\u30e6\u30fc\u30b6\u30fc'. $i,<\/strong>\r\n<strong>                'email' =&gt; 'user'. $i .'@example.com',<\/strong>\r\n<strong>                'password' =&gt; bcrypt('xxxxxxxx')<\/strong>\r\n<strong>            ]);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n    }\r\n}<\/pre>\n<p><strong>\u203b\u6ce8\u610f<\/strong><\/p>\n<p>\u305f\u3060\u3057\u3001Seed\u30d5\u30a1\u30a4\u30eb\u306f\u4f5c\u6210\u3059\u308b\u3060\u3051\u3067\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001\u300c<strong>database\/seeds\/DatabaseSeeder.php<\/strong>\u300d\u306erun()\u5185\u306b\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$this-&gt;call(UsersTableSeeder::class);<\/strong><\/pre>\n<h1>\u671f\u9650\u306e\u5207\u308c\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u30fb\u30ea\u30bb\u30c3\u30c8\u306e\u30c8\u30fc\u30af\u30f3\u3092\u524a\u9664\u3059\u308b<\/h1>\n<pre><strong>php artisan auth:clear-resets<\/strong><\/pre>\n<p>Laravel\u3067\u306f\u300cphp artisan make:auth\u300d\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30ea\u30bb\u30c3\u30c8\u30da\u30fc\u30b8\u3082\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-784\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/password_reset.png\" alt=\"\" width=\"760\" height=\"212\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/password_reset.png 760w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/password_reset-300x84.png 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30da\u30fc\u30b8\u304b\u3089\u30d1\u30b9\u30ef\u30fc\u30c9\u30fb\u30ea\u30bb\u30c3\u30c8\u3092\u7533\u8acb\u3059\u308b\u3068\u300c<strong>password_resets<\/strong>\u300d\u30c6\u30fc\u30d6\u30eb\u306e\u4e2d\u306b\u30c8\u30fc\u30af\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3001\u3053\u306e\u30c8\u30fc\u30af\u3092\u5143\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u518d\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u300c<strong>auth:clear-resets<\/strong>\u300d\u30b3\u30de\u30f3\u30c9\u306f\u3001\u3053\u306e\u30c8\u30fc\u30af\u30f3\u306e\u4e2d\u304b\u3089\u671f\u9650\u304c\u5207\u308c\u305f\u3082\u306e\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b\u3061\u306a\u307f\u306b\u3001\u6709\u52b9\u671f\u9650\u306f\u300cconfig\/auth.php\u300d\u5185\u306e\u300cexpire\u300d\uff08\u5206\uff09\u3067\u5224\u65ad\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>'passwords' =&gt; [\r\n    'users' =&gt; [\r\n        'provider' =&gt; 'users',\r\n        'table' =&gt; 'password_resets',\r\n        <strong>'expire' =&gt; 60<\/strong>,\r\n    ],\r\n],<\/pre>\n<h2>\u7279\u5b9a\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30fb\u30ea\u30bb\u30c3\u30c8\u30b0\u30eb\u30fc\u30d7\u540d\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<pre><strong>artisan auth:clear-resets (\u30b0\u30eb\u30fc\u30d7\u540d)<\/strong><\/pre>\n<p>auth:clear-resets\u306b\u306f\u7279\u5b9a\u306e\u30b0\u30eb\u30fc\u30d7\u540d\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u304c\u8907\u6570\u3042\u308b\u5834\u5408\u306a\u3069\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u307e\u305a\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u300cconfig\/auth.php\u300d\u306b\u65b0\u3057\u3044\u30b0\u30eb\u30fc\u30d7\u300ccustomers\u300d\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>'passwords' =&gt; [\r\n    'users' =&gt; [\r\n        'provider' =&gt; 'users',\r\n        'table' =&gt; 'password_resets',\r\n        'expire' =&gt; 60,\r\n    ],\r\n<strong>    'customers' =&gt; [<\/strong>\r\n<strong>        'provider' =&gt; 'users',<\/strong>\r\n<strong>        'table' =&gt; 'password_resets',<\/strong>\r\n<strong>        'expire' =&gt; 10,<\/strong>\r\n<strong>    ],<\/strong>\r\n],<\/pre>\n<p>\u305d\u3057\u3066\u3001\u300cauth:clear-resets\u300d\u3067\u671f\u9650\u5207\u308c\u306e\u30c8\u30fc\u30af\u30f3\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b0\u30eb\u30fc\u30d7\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>artisan auth:clear-resets <strong>customers<\/strong><\/pre>\n<p>\u3053\u308c\u3067customers\u306b\u95a2\u9023\u3059\u308b\u30c8\u30fc\u30af\u30f3\u3060\u3051\u3092\u5bfe\u8c61\u3068\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08cache:clear\uff09<\/h1>\n<pre><strong>php artisan cache:clear<\/strong><\/pre>\n<p>\u300cstorage\/framework\/cache\/data\u300d\u5185\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p><strong>\u203b\u6ce8\u610f<\/strong><\/p>\n<p>\u305f\u3060\u3057\u3001PHP\u5074\u3067\u4f5c\u6210\u3057\u305f\u30ad\u30e3\u30c3\u30b7\u30e5\u306f\u300c\u4f5c\u6210\u30e6\u30fc\u30b6\u30fc\u300d\u304c\u9055\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u306f\u6a29\u9650\u4e0d\u8db3\u3067\u524a\u9664\u304c\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3092\u76f4\u524d\u306b\u5b9f\u884c\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>sudo chmod 777 storage -R<\/strong><\/pre>\n<h2>\u7279\u5b9a\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u30fb\u30c9\u30e9\u30a4\u30d0\u30fc\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>\u300cconfig\/cache.php\u300d\u306e\u300cstores\u300d\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u30fb\u30c9\u30e9\u30a4\u30d0\u30fc\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u5909\u6570\u3068\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan cache:clear <strong>database<\/strong><\/pre>\n<p>\u203b\u3061\u306a\u307f\u306bLaravel\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u30fb\u30c9\u30e9\u30a4\u30d0\u30fc\u306f\u521d\u671f\u72b6\u614b\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>'stores' =&gt; [\r\n\r\n    <strong>'apc'<\/strong> =&gt; [\r\n        'driver' =&gt; 'apc',\r\n    ],\r\n\r\n    <strong>'array'<\/strong> =&gt; [\r\n        'driver' =&gt; 'array',\r\n    ],\r\n\r\n    <strong>'database'<\/strong> =&gt; [\r\n        'driver' =&gt; 'database',\r\n        'table' =&gt; 'cache',\r\n        'connection' =&gt; null,\r\n    ],\r\n\r\n    <strong>'file'<\/strong> =&gt; [\r\n        'driver' =&gt; 'file',\r\n        'path' =&gt; storage_path('framework\/cache\/data'),\r\n    ],\r\n\r\n    <strong>'memcached'<\/strong> =&gt; [\r\n        'driver' =&gt; 'memcached',\r\n        'persistent_id' =&gt; env('MEMCACHED_PERSISTENT_ID'),\r\n        'sasl' =&gt; [\r\n            env('MEMCACHED_USERNAME'),\r\n            env('MEMCACHED_PASSWORD'),\r\n        ],\r\n        'options' =&gt; [\r\n            \/\/ Memcached::OPT_CONNECT_TIMEOUT  =&gt; 2000,\r\n        ],\r\n        'servers' =&gt; [\r\n            [\r\n                'host' =&gt; env('MEMCACHED_HOST', '127.0.0.1'),\r\n                'port' =&gt; env('MEMCACHED_PORT', 11211),\r\n                'weight' =&gt; 100,\r\n            ],\r\n        ],\r\n    ],\r\n\r\n    <strong>'redis'<\/strong> =&gt; [\r\n        'driver' =&gt; 'redis',\r\n        'connection' =&gt; 'default',\r\n    ],\r\n\r\n],<\/pre>\n<h2>\u30bf\u30b0\u3092\u6307\u5b9a\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08&#8211;tags\uff09<\/h2>\n<pre>php artisan cache:clear <strong>--tags=(\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30bf\u30b0)<\/strong><\/pre>\n<p>\u30bf\u30b0\u3092\u6307\u5b9a\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u306b\u306f\u300c&#8211;tags\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002\u8907\u6570\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u30ab\u30f3\u30de\u3067\u533a\u5207\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan cache:clear --tags=<strong>key1,key2,key3<\/strong><\/pre>\n<p><strong>\u203b\u6ce8\u610f<\/strong><\/p>\n<p>\u305f\u3060\u3057\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u30bf\u30b0\u304c\u4f7f\u3048\u308b\u306e\u306f<strong>\u300cfile\u300d\u300cdatabase\u300d\u4ee5\u5916\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u30fb\u30c9\u30e9\u30a4\u30d0\u30fc\u3067\u3059\u3002<\/strong><\/p>\n<h1>\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u3066\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08cache:forget\uff09<\/h1>\n<pre><strong>php artisan cache:forget (\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30ad\u30fc)<\/strong><\/pre>\n<p>\u76f4\u63a5\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u3066\u524a\u9664\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u203b\u305f\u3060\u3057\u3001\u4f5c\u6210\u30e6\u30fc\u30b6\u30fc\u304c\u7570\u306a\u308b\u3068\u300c\u524a\u9664\u3057\u307e\u3057\u305f\u300d\u3068\u8868\u793a\u304c\u3067\u307e\u3059\u304c\u3001<strong>\u5b9f\u969b\u306b\u306f\u524a\u9664\u3067\u304d\u3066\u3044\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u306e\u3067\u6c17\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/p>\n<p>\u3082\u3057\u7279\u5b9a\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u30fb\u30c9\u30e9\u30a4\u30d0\u30fc\u3082\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u7b2c\uff12\u5f15\u6570\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan cache:forget my-cache <strong>file<\/strong><\/pre>\n<h1>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\uff08cache:table\uff09<\/h1>\n<pre>php artisan cache:table<\/pre>\n<p>Laravel\u306f\u521d\u671f\u72b6\u614b\u3067\u306f\u3001\u305f\u3068\u3048\u300c.env\u300d\u3067\u8a2d\u5b9a\u3092\u3057\u3066\u3082\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3063\u305f\u30ad\u30e3\u30c3\u30b7\u30e5\u4fdd\u5b58\u306b\u306f\u5bfe\u5fdc\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre>CACHE_DRIVER=<strong>database<\/strong><\/pre>\n<p>\u306a\u305c\u306a\u3089\u3001\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u30c6\u30fc\u30d6\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u304b\u3089\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u307e\u305a\u306f\u300cphp artisan cache:table\u300d\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u5f8c\u300cphp artisan migrate\u300d\u3092\u5b9f\u884c\u3057\u3066\u5c02\u7528\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3053\u308c\u304c\u7d42\u308f\u308b\u3068DB\u5185\u306b\u300ccache\u300d\u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-786\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/cache_table.png\" alt=\"\" width=\"532\" height=\"370\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/cache_table.png 532w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/cache_table-300x209.png 300w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/p>\n<h1>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\uff08config:cache\uff09<\/h1>\n<pre><strong>php artisan config:cache<\/strong><\/pre>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3057\u3066\u304a\u304f\u3068\u3001\u6bce\u56de\u8aad\u307f\u8fbc\u3080\u4f5c\u696d\u3092\u7701\u7565\u3067\u304d\u308b\u306e\u3067\u30da\u30fc\u30b8\u8868\u793a\u306e\u9ad8\u901f\u5316\u5bfe\u7b56\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08config:clear\uff09<\/h1>\n<pre><strong>php artisan config:clear<\/strong><\/pre>\n<p>\u524d\u9805\u76ee\u3067\u4f5c\u6210\u3057\u305f\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<h1>seed\u3092\u5b9f\u884c\u3059\u308b\uff08db:seed\uff09<\/h1>\n<pre><strong>php artisan db:seed<\/strong><\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u521d\u671f\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308bSeed\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u203b\u3061\u306a\u307f\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300cmigrate\u300d\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>php artisan migrate <strong>--seed<\/strong><\/pre>\n<h2>\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066Seed\u3059\u308b\uff08&#8211;class\uff09<\/h2>\n<pre>php artisan db:seed <strong>--class=(\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u300cDatabaseSeeder\u300d\u304c\u547c\u3070\u308c\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u500b\u5225\u306eSeed\u30af\u30e9\u30b9\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>php artisan db:seed <strong>--class=UsersTableSeeder<\/strong><\/pre>\n<h2>DB\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066Seed\u3059\u308b\uff08&#8211;database\uff09<\/h2>\n<pre>php artisan db:seed <strong>--database=mysql<\/strong><\/pre>\n<p>migrate\u306e\u300c&#8211;database\u300d\u3068\u540c\u3058\u3067\u3059\u3002\u8a73\u3057\u304f\u306f<a href=\"#database_option\">\u3053\u3061\u3089<\/a>\u3002<\/p>\n<h2>\u78ba\u8a8d\u3092\u7701\u7565\u3057\u3066Seed\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<pre>php artisan db:seed <strong>--force<\/strong><\/pre>\n<p>migrate\u306e\u300c&#8211;force\u300d\u3068\u540c\u3058\u3067\u3059\u3002\u8a73\u3057\u304f\u306f<a href=\"#force_option\">\u3053\u3061\u3089<\/a>\u3002<\/p>\n<h1 id=\"event_generate\">\u30a4\u30d9\u30f3\u30c8\u3068\u30ea\u30b9\u30ca\u30fc\u3092\u81ea\u52d5\u3067\u4f5c\u6210\u3059\u308b\uff08event:generate\uff09<\/h1>\n<pre><strong>php artisan event:generate<\/strong><\/pre>\n<p>\u3082\u3061\u308d\u3093\u30a4\u30d9\u30f3\u30c8\u3068\u3001\u305d\u306e\u30ea\u30b9\u30ca\u30fc\u306f\u624b\u52d5\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u6570\u304c\u591a\u304f\u306a\u3063\u3066\u304f\u308b\u3068\u3081\u3093\u3069\u3046\u306a\u4f5c\u696d\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u81ea\u52d5\u5316\u3059\u308b\u306e\u304c\u300cevent:generate\u300d\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u300capp\/Providers\/EventServiceProvider.php\u300d\u3092\u958b\u3044\u3066\u300c$listen\u300d\u306b\u767b\u9332\u3057\u305f\u3044\u30a4\u30d9\u30f3\u30c8\u3068\u30ea\u30b9\u30bf\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\uff08\u203b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u8a18\u8ff0\u3055\u308c\u305f\u3082\u306e\u3067\u3059\uff09<\/p>\n<pre>protected $listen = [\r\n<strong>    'App\\Events\\Event' =&gt; [<\/strong>\r\n<strong>        'App\\Listeners\\EventListener',<\/strong>\r\n<strong>    ],<\/strong>\r\n];<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u6cc1\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30d5\u30a9\u30eb\u30c0\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-789\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/event_generate.png\" alt=\"\" width=\"278\" height=\"301\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/event_generate.png 278w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/event_generate-277x300.png 277w\" sizes=\"auto, (max-width: 278px) 100vw, 278px\" \/><\/p>\n<p>EventServiceProvider\u3067\u767b\u9332\u3057\u305f\u30a4\u30d9\u30f3\u30c8\u3068\u30ea\u30b9\u30ca\u30fc\u304c\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30ad\u30fc\u3092\u66f4\u65b0\u3059\u308b\uff08key:generate\uff09<\/h1>\n<pre><strong>php artisan key:generate<\/strong><\/pre>\n<p>Laravel\u306f\u300c.env\u300d\u5185\u306e\u300cAPP_KEY\u300d\u306b\u3042\u308b\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\uff08\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30ad\u30fc\uff09\u3092\u4f7f\u3063\u3066\u6697\u53f7\u5316\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u305d\u306e\u30ad\u30fc\u3092\u65b0\u3057\u3044\u3082\u306e\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u65b0\u3057\u3044\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30ad\u30fc\u3092\u8868\u793a\u3060\u3051\u3059\u308b\uff08&#8211;show\uff09<\/h2>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u300c.env\u300d\u5185\u306e\u300cAPP_KEY\u300d\u306f<strong>\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u308c\u305a\u3001\u65b0\u3057\u3044\u30ad\u30fc\u306e\u8868\u793a\u3060\u3051<\/strong>\u3092\u884c\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u81ea\u5206\u3067\u30ad\u30fc\u306e\u5909\u66f4\u3092\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<h2>\u78ba\u8a8d\u3092\u7701\u7565\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<p>migrate\u306e\u300c&#8211;force\u300d\u3068\u540c\u3058\u3067\u3059\u3002\u8a73\u3057\u304f\u306f<a href=\"#force_option\">\u3053\u3061\u3089<\/a>\u3002<\/p>\n<h1>Channel\u3092\u4f5c\u6210\u3059\u308b\uff08make:channel\uff09<\/h1>\n<pre><strong>php artisan make:channel (Channel\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u65b0\u3057\u304fBroadcasting\u306eChannel\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306b\u5229\u7528\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u5b9f\u969b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>php artisan make:channel <strong>OrderChannnel<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300capp\/Broadcasting\u300d\u30d5\u30a9\u30eb\u30c0\u306b\u65b0\u3057\u3044Channel\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-790\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_channel.png\" alt=\"\" width=\"276\" height=\"259\" \/><\/p>\n<h1>artisan\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:command\uff09<\/h1>\n<pre><strong>php artisan make:command (\u30b3\u30de\u30f3\u30c9\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u72ec\u81ea\u306eartisan\u30b3\u30de\u30f3\u30c9\u306b\u5fc5\u8981\u306a\u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f5c\u6210\u3057\u305f\u3044\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>php artisan make:command <strong>TestCommand<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u300capp\/Console\/Commands\u300d\u5185\u306b\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-791\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_command.png\" alt=\"\" width=\"277\" height=\"212\" \/><\/p>\n<h2>\u30b3\u30de\u30f3\u30c9\u3092\u547c\u3073\u51fa\u3059\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;command\uff09<\/h2>\n<pre>php artisan make:command TestCommand <strong>--command=<\/strong>test:command<\/pre>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u3001\u65b0\u3057\u304f\u4f5c\u6210\u3055\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u300c$signature\u300d\u3092\u81ea\u52d5\u3067\u5165\u308c\u66ff\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre>protected $signature = <strong>'test:command'<\/strong>;<\/pre>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08make:controller\uff09<\/h1>\n<pre><strong>php artisan make:controller (\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u65b0\u3057\u304f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306b\u4f7f\u3046\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u300capp\/Http\/Controllers\u300d\u5185\u306b\u65b0\u3057\u3044\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u968e\u5c64\u3092\u6df1\u304f\u3057\u3066\u4f5c\u6210\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e52\u3064\u3092\u3064\u3051\u308b\u3068\u81ea\u52d5\u7684\u306b\u968e\u5c64\u3092\u6df1\u304f\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre>php artisan make:controller <strong>User\\\\HomeController<\/strong><\/pre>\n<p>\u203b\u3053\u306e\u5834\u5408\u306f\u300capp\/Http\/Controllers<strong>\/User\/HomeController.php<\/strong>\u300d\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30e2\u30c7\u30eb\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3059\u308b\uff08&#8211;model, -m\uff09<\/h2>\n<pre>php artisan make:controller ItemController <strong>--model=<\/strong>Item<\/pre>\n<p>\u3082\u3057\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u30e2\u30c7\u30eb\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u5185\u306b\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3059\u308b\uff08\u2252RESTful\u306a\u69cb\u6210\u306b\u3059\u308b\uff09\u5834\u5408\u306f\u300c<strong>&#8211;model<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u3001<\/p>\n<ul>\n<li><strong>index<\/strong><\/li>\n<li><strong>create<\/strong><\/li>\n<li><strong>store<\/strong><\/li>\n<li><strong>show<\/strong><\/li>\n<li><strong>edit<\/strong><\/li>\n<li><strong>update<\/strong><\/li>\n<li><strong>destroy<\/strong><\/li>\n<\/ul>\n<p>\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u4f5c\u6210\u3055\u308c\u3001\u3055\u3089\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u81ea\u52d5\u7684\u306b\u30e2\u30c7\u30eb\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre>public function show(<strong>Item $item<\/strong>)\r\n{\r\n    \/\/\r\n}<\/pre>\n<h2>\u30ea\u30bd\u30fc\u30b9\u7528\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;resource, -r\uff09<\/h2>\n<pre>php artisan make:controller ItemController <strong>--resource<\/strong><\/pre>\n<p>\u524d\u9805\u76ee\u306e\u300c&#8211;model\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3061\u3089\u306f\u30e2\u30c7\u30eb\u306e\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306f\u305b\u305a\u3001\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306b\u300c$request\u300d\u3084\u300c$id\u300d\u304c\u3064\u3044\u305f\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>public function update(<strong>Request $request, $id<\/strong>)\r\n{\r\n    \/\/\r\n}<\/pre>\n<h2>API\u7528\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;api\uff09<\/h2>\n<pre>php artisan make:controller ItemController <strong>--api<\/strong><\/pre>\n<p>\u524d\u9805\u76ee\u306e\u300c&#8211;resource\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u4ee5\u4e0b\uff12\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3064\u307e\u308aAPI\u7528\u306a\u306e\u3067\u3001\u5165\u529b\u30da\u30fc\u30b8\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u5b58\u5728\u3057\u306a\u3044\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<ul>\n<li><strong>create<\/strong><\/li>\n<li><strong>edit<\/strong><\/li>\n<\/ul>\n<h1>\u30a4\u30d9\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:event\uff09<\/h1>\n<pre><strong>php artisan make:event (\u30a4\u30d9\u30f3\u30c8\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u65b0\u3057\u304f\u30a4\u30d9\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001Item\u3067\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan make:event <strong>ItemSaved<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u300capp\/Events\u300d\u5185\u306b\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-792\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_event.png\" alt=\"\" width=\"277\" height=\"192\" \/><\/p>\n<h1>Exception\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:exception\uff09<\/h1>\n<pre><strong>php artisan make:exception (Exception\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u72ec\u81ea\u306eException\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u5fc5\u8981\u306a\u5f15\u6570\u306f\u30af\u30e9\u30b9\u540d\u3067\u3059\u3002<\/p>\n<pre>php artisan make:exception <strong>OrderException<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Exceptions\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-794\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_exception.png\" alt=\"\" width=\"277\" height=\"213\" \/><\/p>\n<h1>Factory\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:factory\uff09<\/h1>\n<pre><strong>php artisan make:factory (Factory\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u72ec\u81ea\u306eException\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u5fc5\u8981\u306a\u5f15\u6570\u306f\u30af\u30e9\u30b9\u540d\u3067\u3059\u3002<\/p>\n<pre>php artisan make:factory <strong>PostFactory<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300cdatabase\/factories\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-796\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_factory.png\" alt=\"\" width=\"276\" height=\"211\" \/><\/p>\n<h2>\u7279\u5b9a\u306e\u30e2\u30c7\u30eb\u3092\u8a2d\u5b9a\u3057\u305fFactory\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;model, -m\uff09<\/h2>\n<pre>php artisan make:factory ItemFactory <strong>--model=<\/strong>Item<\/pre>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6307\u5b9a\u3057\u305f\u30e2\u30c7\u30eb\u304c\u8a2d\u5b9a\u3055\u308c\u305fFactory\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>$factory-&gt;define(<strong>App\\Item::class<\/strong>, function (Faker $faker) {\r\n    return [\r\n        \/\/\r\n    ];\r\n});<\/pre>\n<h1>Job\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:job\uff09<\/h1>\n<pre><strong>php artisan make:job (Job\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>Job\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u5fc5\u8981\u306a\u5f15\u6570\u306f\u30af\u30e9\u30b9\u540d\u3067\u3059\u3002<\/p>\n<pre>php artisan make:job <strong>ProcessPodcast<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Jobs\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-798\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_job.png\" alt=\"\" width=\"275\" height=\"236\" \/><\/p>\n<h2>\u540c\u671f\u578b\u306eJob\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;sync\uff09<\/h2>\n<pre>php artisan make:job ProcessPodcast -<strong>-sync<\/strong><\/pre>\n<p>\u52d5\u6a5f\u3092\u660e\u793a\u3057\u305fJob\u3092\u4f5c\u6210\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h1>\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08make:listener\uff09<\/h1>\n<pre><strong>php artisan make:listener (\u30ea\u30b9\u30ca\u30fc\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:listener <strong>SendInvoice<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Listeners\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-799\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_listener.png\" alt=\"\" width=\"276\" height=\"259\" \/><\/p>\n<p>\u203b\u305f\u3060\u3057\u3001\u300c<a href=\"#event_generate\">event:generate<\/a>\u300d\u3092\u4f7f\u3048\u3070\u30a4\u30d9\u30f3\u30c8\u3068\u30ea\u30b9\u30ca\u30fc\u3092\u4e00\u5ea6\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u306e\u65b9\u304c\u52b9\u7387\u7684\u306b\u4f5c\u696d\u304c\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2>\u30a4\u30d9\u30f3\u30c8\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3057\u305f\u30ea\u30b9\u30ca\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;event\uff09<\/h2>\n<pre>php artisan make:listener SendInvoice <strong>--event=<\/strong>OrderCreated<\/pre>\n<p>\u30a4\u30d9\u30f3\u30c8\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3057\u305f\u72b6\u614b\u306e\u30ea\u30b9\u30ca\u30fc\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u3001\u300c&#8211;event\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u307e\u3059\u3002\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300chundle()\u300d\u30e1\u30bd\u30c3\u30c9\u306b\u30a4\u30d9\u30f3\u30c8\u30af\u30e9\u30b9\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<pre>public function handle(<strong>OrderCreated $event<\/strong>)\r\n{\r\n    \/\/\r\n}<\/pre>\n<h1>mailable\u3092\u4f5c\u6210\u3059\u308b\uff08make:mail\uff09<\/h1>\n<pre><strong>php artisan make:mail (mailable\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u30e1\u30fc\u30eb\u9001\u4fe1\u30d5\u30a1\u30a4\u30eb\uff08mailable\uff09\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:mail <strong>inquiryReceived<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Mail\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-801\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_mail.png\" alt=\"\" width=\"276\" height=\"257\" \/><\/p>\n<h2 id=\"overwrite_option\">\u4e0a\u66f8\u304d\u78ba\u8a8d\u3092\u7701\u7565\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<pre>php artisan make:mail inquiryReceived --force<\/pre>\n<p>\u540c\u3058\u540d\u524d\u306emailable\u304c\u3042\u308b\u5834\u5408\u306b\u306f\u78ba\u8a8d\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u300c&#8211;force\u300d\u306f\u3053\u308c\u3092\u7701\u7565\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>markdown\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3082\u540c\u6642\u306b\u4f5c\u6210\u3059\u308b\uff08&#8211;markdown\uff09<\/h2>\n<pre>php artisan make:mail inquiryReceived <strong>--markdown=<\/strong>emails.inquiry.received<\/pre>\n<p>\u300c&#8211;markdown\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u3001\u300cresources\/views\u300d\u4ee5\u4e0b\u306bmarkdown\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u540c\u6642\u306b\u4f5c\u6210\u3067\u304d\u3001\u3055\u3089\u306bmailable\u5185\u306b\u3082\u305d\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u81ea\u52d5\u3067\u8a18\u8ff0\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>public function build()\r\n{\r\n    return $this-&gt;<strong>markdown('emails.inquiry.received')<\/strong>;\r\n}<\/pre>\n<h1>\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u4f5c\u6210\u3059\u308b\uff08make:middleware\uff09<\/h1>\n<pre><strong>php artisan make:middleware (middleware\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>middleware\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:middleware <strong>CheckCountry<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Http\/Middleware\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-802\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_middleware.png\" alt=\"\" width=\"277\" height=\"394\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_middleware.png 277w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_middleware-211x300.png 211w\" sizes=\"auto, (max-width: 277px) 100vw, 277px\" \/><\/p>\n<h1>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\uff08make:migration\uff09<\/h1>\n<pre><strong>php artisan make:migration (\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:migration <strong>create_items_table<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300cdatabase\/migrations\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u65b0\u3057\u304f\u4f5c\u6210\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;create\uff09<\/h2>\n<pre>php artisan make:migration create_items_table <strong>--create=<\/strong>xxx<\/pre>\n<p>\u3082\u3057\u30c7\u30d5\u30a9\u30eb\u30c8\u4ee5\u5916\u306e\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u300c&#8211;create\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u307e\u3059\u3002\u4e0a\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300cxxx\u300d\u304c\u30c6\u30fc\u30d6\u30eb\u540d\u3068\u3057\u3066\u8a18\u8ff0\u3055\u308c\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>Schema::<strong>create('xxx'<\/strong>, function (Blueprint $table) {\r\n    $table-&gt;increments('id');\r\n    $table-&gt;timestamps();\r\n});<\/pre>\n<h2>\u3059\u3067\u306b\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;table\uff09<\/h2>\n<pre>php artisan make:migration create_items_table <strong>--table=<\/strong>yyy<\/pre>\n<p>\u4f8b\u3048\u3070\u3001\u3059\u3067\u306b\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u306b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u3072\u3068\u3064\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002\u4e0a\u306e\u4f8b\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>Schema::<strong>table('yyy'<\/strong>, function (Blueprint $table) {\r\n    \/\/\r\n});<\/pre>\n<h2>\u4fdd\u5b58\u3059\u308b\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;path\uff09<\/h2>\n<pre>php artisan make:migration create_items_table <strong>--path=<\/strong>database\/migrations2<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u305f\u3044\u30d5\u30a9\u30eb\u30c0\u3092\u3057\u3066\u3044\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h2>realpath\u3067\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;realpath\uff09<\/h2>\n<pre>php artisan make:migration create_items_table --path=database\/migrations <strong>--realpath<\/strong><\/pre>\n<p>\u300c&#8211;path\u300d\u3067\u6307\u5b9a\u3059\u308b\u30d1\u30b9\u3092realpath\u3067\u6307\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002realpath\u306b\u3064\u3044\u3066\u306f<a href=\"http:\/\/php.net\/manual\/ja\/function.realpath.php\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:model\uff09<\/h1>\n<pre><strong>php artisan make:model (\u30e2\u30c7\u30eb\u540d)<\/strong><\/pre>\n<p>\u65b0\u3057\u304f\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4f8b\u3048\u3070\u300cItem\u300d\u3068\u3044\u3046\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>php artisan make:model <strong>Item<\/strong><\/pre>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3001Factory\u3001\u30ea\u30bd\u30fc\u30b9\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u540c\u6642\u306b\u4f5c\u6210\u3059\u308b\uff08&#8211;all, -a\uff09<\/h2>\n<pre>php artisan make:model Item <strong>--all<\/strong><\/pre>\n<p>\u3064\u307e\u308a\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u4ee5\u4e0b\u306e\uff14\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>\u30e2\u30c7\u30eb<\/strong><\/li>\n<li><strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/strong><\/li>\n<li><strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong><\/li>\n<li><strong>Factory<\/strong><\/li>\n<\/ul>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3082\u540c\u6642\u306b\u4f5c\u6210\u3059\u308b\uff08&#8211;controller, -c\uff09<\/h2>\n<pre>php artisan make:model Item <strong>--controller<\/strong><\/pre>\n<p>\u3053\u306e\u4f8b\u306e\u5834\u5408\u3001\u300capp\/Http\/Controllers\/ItemController.php\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>Factory\u3082\u540c\u6642\u306b\u4f5c\u6210\u3059\u308b\uff08&#8211;factory, -f\uff09<\/h2>\n<pre>php artisan make:model Item <strong>--factory<\/strong><\/pre>\n<p>\u3053\u306e\u4f8b\u306e\u5834\u5408\u3001\u300cdatabase\/factories\/ItemFactory.php\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3082\u540c\u6642\u306b\u4f5c\u6210\u3059\u308b\uff08&#8211;migration, -m\uff09<\/h2>\n<pre>php artisan make:model Item <strong>--migration<\/strong><\/pre>\n<p>\u3053\u306e\u4f8b\u306e\u5834\u5408\u3001\u300cdatabase\/migrations\/(\u65e5\u4ed8)_create_items_table.php\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>Pivot\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;pivot, -p\uff09<\/h2>\n<pre>php artisan make:model Item <strong>--pivot<\/strong><\/pre>\n<h2>\u30ea\u30bd\u30fc\u30b9\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;resource, -r\uff09<\/h2>\n<pre>php artisan make:model Item <strong>--resource<\/strong><\/pre>\n<p>\u3053\u306e\u4f8b\u306e\u5834\u5408\u3001\u300capp\/Http\/Controllers\/ItemController.php\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u4e0a\u66f8\u304d\u78ba\u8a8d\u3092\u7701\u7565\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<p><a href=\"#overwrite_option\">\u3053\u3061\u3089<\/a>\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<h1>Notification\u3092\u4f5c\u6210\u3059\u308b\uff08make:notification\uff09<\/h1>\n<pre><strong>php artisan make:notification (notification\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>Notification\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:notification <strong>ItemOrdered<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Notifications\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-803\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_notification.png\" alt=\"\" width=\"276\" height=\"280\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_notification.png 276w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_notification-100x100.png 100w\" sizes=\"auto, (max-width: 276px) 100vw, 276px\" \/><\/p>\n<h1>Observer\u3092\u4f5c\u6210\u3059\u308b\uff08make:observer\uff09<\/h1>\n<pre><strong>php artisan make:observer (Observer\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>Observer\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:observer <strong>UserObserver<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Observers\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-804\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_observer.png\" alt=\"\" width=\"277\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_observer.png 277w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_observer-275x300.png 275w\" sizes=\"auto, (max-width: 277px) 100vw, 277px\" \/><\/p>\n<h2>\u30e2\u30c7\u30eb\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3059\u308b\uff08&#8211;model\uff09<\/h2>\n<pre>php artisan make:observer UserObserver <strong>--model=User<\/strong><\/pre>\n<p>\u300c&#8211;model\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f5c\u6210\u3055\u308c\u308bObserver\u5185\u306b\u6307\u5b9a\u3055\u308c\u305f\u30e2\u30c7\u30eb\u304c\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>public function created(<strong>User $user<\/strong>)\r\n{\r\n    \/\/\r\n}<\/pre>\n<h1>Policy\u3092\u4f5c\u6210\u3059\u308b\uff08make:policy\uff09<\/h1>\n<pre><strong>php artisan make:policy (Policy\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>Policy\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:policy <strong>ItemPolicy<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Policies\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-805\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_policy.png\" alt=\"\" width=\"277\" height=\"304\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_policy.png 277w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_policy-273x300.png 273w\" sizes=\"auto, (max-width: 277px) 100vw, 277px\" \/><\/p>\n<h2>\u30e2\u30c7\u30eb\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3059\u308b\uff08&#8211;model\uff09<\/h2>\n<pre>php artisan make:policy ItemPolicy <strong>--model=Item<\/strong><\/pre>\n<p>\u300c&#8211;model\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f5c\u6210\u3055\u308c\u308bPolicy\u5185\u306b\u6307\u5b9a\u3055\u308c\u305f\u30e2\u30c7\u30eb\u304c\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>public function view(User $user, <strong>Item $item<\/strong>)\r\n{\r\n    \/\/\r\n}<\/pre>\n<h1>\u30b5\u30fc\u30d3\u30b9\u30fb\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u4f5c\u6210\u3059\u308b\uff08make:provider\uff09<\/h1>\n<pre><strong>php artisan make:provider (Provider\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u30b5\u30fc\u30d3\u30b9\u30fb\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:privider <strong>TestServiceProvider<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Providers\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_provider.png\" alt=\"\" width=\"347\" height=\"166\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_provider.png 347w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_provider-300x144.png 300w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/p>\n<h1>\u30d5\u30a9\u30fc\u30e0\u30fb\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff08make:request\uff09<\/h1>\n<pre><strong>php artisan make:request (Request\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>\u30d5\u30a9\u30fc\u30e0\u30fb\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:request <strong>ItemRequest<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Http\/Requests\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-807\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_request.png\" alt=\"\" width=\"417\" height=\"283\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_request.png 417w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_request-300x204.png 300w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h1>API\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\uff08make:resource\uff09<\/h1>\n<pre><strong>php artisan make:resource (API\u30ea\u30bd\u30fc\u30b9\u306e\u30af\u30e9\u30b9\u540d)<\/strong><\/pre>\n<p>API\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:request <strong>User<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Http\/Resources\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-808\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_resource.png\" alt=\"\" width=\"251\" height=\"302\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_resource.png 251w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_resource-249x300.png 249w\" sizes=\"auto, (max-width: 251px) 100vw, 251px\" \/><\/p>\n<h2>\u30ea\u30bd\u30fc\u30b9\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3068\u3057\u3066\u4f5c\u6210\u3059\u308b\uff08&#8211;collection\uff09<\/h2>\n<pre>php artisan make:resource User <strong>--collection<\/strong><\/pre>\n<h1>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\uff08make:rule\uff09<\/h1>\n<pre><strong>php artisan make:rule <\/strong><\/pre>\n<p>\u72ec\u81ea\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:rule <strong>Over20<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300capp\/Rules\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-809\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_rule.png\" alt=\"\" width=\"251\" height=\"57\" \/><\/p>\n<h1>\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff08make:test\uff09<\/h1>\n<pre><strong>php artisan make:test (\u30c6\u30b9\u30c8\u306e\u30af\u30e9\u30b9\u540d) <\/strong><\/pre>\n<p>\u30c6\u30b9\u30c8\u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre>php artisan make:test UserTest<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u300ctests\/Feature\u300d\u306b\u65b0\u3057\u304f\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-810\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_test.png\" alt=\"\" width=\"280\" height=\"158\" \/><\/p>\n<h2>Unit\u30d5\u30a9\u30eb\u30c0\u306b\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff08&#8211;unit\uff09<\/h2>\n<pre>php artisan make:test UserTest <strong>--unit<\/strong><\/pre>\n<p>Feature\u30d5\u30a9\u30eb\u30c0\u3067\u306f\u306a\u304f\u3001Unit\u30d5\u30a9\u30eb\u30c0\u306b\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u300c&#8211;unit\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-811\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/make_test_unit.png\" alt=\"\" width=\"281\" height=\"182\" \/><\/p>\n<h1 id=\"migration_fresh\">\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u59cb\u3081\u304b\u3089\u3084\u308a\u76f4\u3059\uff08migrate:fresh\uff09<\/h1>\n<pre><strong>php artisan migrate:fresh<\/strong><\/pre>\n<p>\u300cmigrate:fresh\u300d\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<ol>\n<li><strong>\u5168\u3066\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u524a\u9664\uff08DROP\uff09\u3059\u308b<\/strong><\/li>\n<li><strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u518d\u5b9f\u884c<\/strong><\/li>\n<\/ol>\n<p>\u3053\u308c\u306f\u3001\u6b21\u306e\u9805\u76ee\u3067\u8aac\u660e\u3059\u308b\u300c<strong>migrate:refresh<\/strong>\u300d\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u524a\u9664\u65b9\u6cd5\u304c\u9055\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u300cmigrate:fresh\u300d\u306e\u65b9\u306f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u5185\u306edown()\u3092\u5b9f\u884c\u3059\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001<strong>\u4e00\u6c17\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/strong><\/p>\n<pre><strong>public function down()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    Schema::dropIfExists('*****');<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u305d\u306e\u305f\u3081\u3001\u300cmigrate:fresh\u300d\u306e\u307f\u3092\u4f7f\u3046\u306e\u3067\u3042\u308c\u3070\u3001down()\u30e1\u30bd\u30c3\u30c9\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3057\u3001\u3082\u3057\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u69cb\u9020\u304c\u4f55\u304b\u306e\u539f\u56e0\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3068\u6574\u5408\u6027\u304c\u3068\u308c\u305a\u300cmigrate:refresh\u300d\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u306f\u300cmigrate:fresh\u300d\u3092\u4f7f\u3046\u3068\u521d\u671f\u72b6\u614b\u306b\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;database\uff09<\/h2>\n<pre>php artisan migrate:fresh <strong>--database=(\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u540d)<\/strong><\/pre>\n<p>\u8a73\u3057\u304f\u306f<a href=\"#database_option\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d3\u30e5\u30fc\u3092\u524a\u9664\u3059\u308b(&#8211;drop-views)<\/h2>\n<pre>php artisan migrate:fresh <strong>--drop-views<\/strong><\/pre>\n<p>DB\u306e\u30d3\u30e5\u30fc\u3082\u524a\u9664\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<p>\u203b\u3053\u3053\u3067\u3044\u3046\u300cview\u300d\u3068\u306fLaravel\u306e\u30d3\u30e5\u30fc\u3067\u306f\u306a\u304f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d3\u30e5\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u884c\u78ba\u8a8d\u3092\u7701\u7565\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<pre>php artisan migrate:fresh <strong>--force<\/strong><\/pre>\n<p>\u8a73\u3057\u304f\u306f<a href=\"#force_option\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;path\uff09<\/h2>\n<pre>php artisan migrate:fresh <strong>--path=(\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9)<\/strong><\/pre>\n<p>\u8a73\u3057\u304f\u306f<a href=\"#migration_path\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a9\u30eb\u30c0\u3092realpath\u3067\u6307\u5b9a\u3059\u308b\uff08&#8211;realpath\uff09<\/h2>\n<pre>php artisan migrate:fresh <strong>--path=(\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a9\u30eb\u30c0\u306e\u30d1\u30b9)<\/strong> <strong>--realpath<\/strong><\/pre>\n<p>\u8a73\u3057\u304f\u306f<a href=\"#migration_realpath\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>Seed\u3082\u540c\u6642\u306b\u5b9f\u884c\u3059\u308b\uff08&#8211;seed\uff09<\/h2>\n<pre>php artisan migrate:fresh <strong>--seed<\/strong><\/pre>\n<p>\u8a73\u3057\u304f\u306f<a href=\"#migration_seed\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>Seed\u3092\u30af\u30e9\u30b9\u540d\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\uff08&#8211;seeder\uff09<\/h2>\n<pre>php artisan migrate:fresh <strong>--seeder=UsersTableSeeder<\/strong><\/pre>\n<p>\u7279\u5b9a\u306eSeed\u3060\u3051\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u306b\u4f7f\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h1>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u59cb\u3081\u304b\u3089\u3084\u308a\u76f4\u3059\uff08migrate:refresh\uff09<\/h1>\n<pre><strong>php artisan migrate:refresh<\/strong><\/pre>\n<p>\u5168\u3066\u306e\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u5b9f\u884c\u3057\u3066\u3001\u518d\u5ea6\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u306a\u304a\u3057\u307e\u3059\u3002\u300cmigrate:fresh\u300d\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u30c6\u30fc\u30d6\u30eb\u3092\u524a\u9664\u3059\u308b\u308f\u3051\u3067\u306f\u306a\u304fdown()\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u70b9\u304c\u9055\u3063\u3066\u3044\u307e\u3059\u3002\u8a73\u3057\u304f\u306f<a href=\"#migration_fresh\">migrate:fresh<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3082<a href=\"#migration_fresh\">migrate:fresh<\/a>\u3068\u5185\u5bb9\u306f\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>&#8211;database<\/li>\n<li>&#8211;force<\/li>\n<li>&#8211;path<\/li>\n<li>&#8211;realpath<\/li>\n<li>&#8211;seed<\/li>\n<li>&#8211;seeder<\/li>\n<\/ul>\n<h2 id=\"migrate_rollback_step\">\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3059\u308b\u30b9\u30c6\u30c3\u30d7\u6570\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;step\uff09<\/h2>\n<pre>php artisan migrate:refresh <strong>--step=1<\/strong><\/pre>\n<p>\u3082\u3057\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u5168\u3066\u3067\u306f\u306a\u304f<strong>\u30b9\u30c6\u30c3\u30d7\u6570\u3067\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408<\/strong>\u306f\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h1>\u5168\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u5b9f\u884c\u3059\u308b\uff08migrate:reset\uff09<\/h1>\n<pre><strong>php artisan migrate:reset<\/strong><\/pre>\n<p>\u5168\u3066\u306e\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u306e\u306f\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u306f<strong>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u30c6\u30fc\u30d6\u30eb\u304c\u524a\u9664\u3055\u308c\u308b\u3060\u3051<\/strong>\u3068\u3044\u3046\u70b9\u3067\u3059\u3001\u518d\u5ea6\u30c6\u30fc\u30d6\u30eb\u3092\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u4f5c\u6210\u3057\u305f\u3044\u5834\u5408\u306f\u300cmigrate:fresh\u300d\u3082\u3057\u304f\u306f\u300cmigrate:refresh\u300d\u3092\u4f7f\u3046\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u203b\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f<a href=\"#migration_fresh\">migrate:fresh<\/a>\u3068\u5185\u5bb9\u306f\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>&#8211;database<\/li>\n<li>&#8211;force<\/li>\n<li>&#8211;path<\/li>\n<li>&#8211;realpath<\/li>\n<\/ul>\n<h2>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u5b9f\u884c\u3055\u308c\u308bSQL\u6587\u3092\u8868\u793a\u3059\u308b\uff08&#8211;pretend\uff09<\/h2>\n<pre>php artisan migrate:reset <strong>--pretend<\/strong><\/pre>\n<p><a href=\"#migration_pretend\">migrate &#8211;pretend<\/a>\u3068\u540c\u3058\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<h1>\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u5b9f\u884c\u3059\u308b\uff08migrate:rollback\uff09<\/h1>\n<pre><strong>php artisan migrate:rollback<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u524d\u306e\u72b6\u614b\u306b\u623b\u3059\u300c\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u300d\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u203b\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f<a href=\"#migration_fresh\">migrate:fresh<\/a>\u3068\u5185\u5bb9\u306f\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>&#8211;database<\/li>\n<li>&#8211;force<\/li>\n<li>&#8211;path<\/li>\n<li>&#8211;realpath<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001\u300c&#8211;pretend\u300d\u306f<a href=\"#migration_pretend\">migrate &#8211;pretend<\/a>\u3068\u540c\u3058\u3001\u300c&#8211;step\u300d\u306f<a href=\"#migration_rollback_step\">migrate:fresh &#8211;step=<\/a>\u3068\u540c\u3058\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<h1>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3092\u8868\u793a\u3059\u308b\uff08migrate:status\uff09<\/h1>\n<pre><strong>php artisan migrate:status<\/strong><\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u73fe\u5728\u3069\u306e\u3088\u3046\u306a\u72b6\u614b\u304b\u3092\u8868\u793a\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-815\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/migrate_status.png\" alt=\"\" width=\"589\" height=\"120\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/migrate_status.png 589w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/migrate_status-300x61.png 300w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/p>\n<p>\u203b\u4ee5\u4e0b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f<a href=\"#migration_fresh\">migrate:fresh<\/a>\u3068\u5185\u5bb9\u306f\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>&#8211;database<\/li>\n<li>&#8211;force<\/li>\n<li>&#8211;path<\/li>\n<\/ul>\n<h1>Notification\u30c6\u30fc\u30d6\u30eb\u7528\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\uff08notification:table\uff09<\/h1>\n<pre><strong>php artisan notifications:table<\/strong><\/pre>\n<p>\u203b\u3042\u304f\u307e\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u307e\u3067\u3067\u3059\u306e\u3067\u3001\u300cphp artisan migrate\u300d\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u518d\u69cb\u7bc9\u3059\u308b\uff08package:discover\uff09<\/h1>\n<pre><strong>php artisan package:discover<\/strong><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u300c<strong>bootstrap\/cache\/packages.php<\/strong>\u300d\u3092\u4f5c\u6210\u3057\u306a\u304a\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001composer\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u969b\u306b\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u308b\u6a5f\u80fd\u3092\u624b\u52d5\u3067\u5b9f\u884c\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<h1>\u30ad\u30e5\u30fc\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\uff08queue:table, queue:failed-table\uff09<\/h1>\n<p>\uff08\u30ad\u30e5\u30fc\u672c\u4f53\uff09<\/p>\n<pre><strong>php artisan queue:table<\/strong><\/pre>\n<p>\uff08\u5931\u6557\u3057\u305f\u30ad\u30e5\u30fc\uff09<\/p>\n<pre><strong>php artisan queue:failed-table<\/strong><\/pre>\n<p>\u30ad\u30e5\u30fc\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u904b\u7528\u3059\u308b\u3068\u304d\u306b\u5fc5\u8981\u3068\u306a\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u4e0a\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u5f8c\u300cphp artisan migrate\u300d\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h1>ID\u3092\u6307\u5b9a\u3057\u3066\u5931\u6557\u3057\u305f\u30ad\u30e5\u30fc\u3092\u524a\u9664\u3059\u308b\uff08queue:forget\uff09<\/h1>\n<pre><strong>php artisan queue:forget (\u5931\u6557\u3057\u305f\u30ad\u30e5\u30fc\u306eID)<\/strong><\/pre>\n<h1>\u30ad\u30e5\u30fc\u30fb\u30ea\u30b9\u30ca\u30fc\u3092\u5b9f\u884c\u3059\u308b\uff08queue:listen\uff09<\/h1>\n<pre><strong>php artisan queue:listen<\/strong><\/pre>\n<p>\u30ad\u30e5\u30fc\u3092\u5f85\u3061\u69cb\u3048\u3066\u3001\u5b9f\u884c\u3059\u3079\u304d\u3082\u306e\u304c\u3042\u3063\u305f\u3089\u5b9f\u884c\u3059\u308b\u300c\u30ad\u30e5\u30fc\u30fb\u30ea\u30b9\u30ca\u30fc\u300d\u3092\u8d77\u52d5\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u203b\u305f\u3060\u3057\u3001Laravel 5.3\u4ee5\u964d\u3067\u306f\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u767b\u5834\u3057\u306a\u304f\u306a\u308a\u3001\u300c<a href=\"#queue_work\">queue:work<\/a>\u300d\u306e\u307f\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u30ad\u30e5\u30fc\u30fb\u30ef\u30fc\u30ab\u30fc\u3092\u518d\u8d77\u52d5\u3059\u308b\uff08queue:restart\uff09<\/h1>\n<pre><strong>php artisan queue:restart<\/strong><\/pre>\n<h1>\u5931\u6557\u3057\u305f\u30ad\u30e5\u30fc\u3092\u518d\u5b9f\u884c\u3059\u308b\uff08queue:retry\uff09<\/h1>\n<pre><strong>php artisan queue:retry (\u5931\u6557\u3057\u305f\u30ad\u30e5\u30fc\u306eID\u3001\u3082\u3057\u304f\u306f\u300call\u300d)<\/strong><\/pre>\n<h1 id=\"queue_work\">\u30ad\u30e5\u30fc\u3092\u5b9f\u884c\u3059\u308b\uff08queue:work\uff09<\/h1>\n<pre><strong>php artisan queue:work<\/strong><\/pre>\n<p>\u5e38\u99d0\u30d7\u30ed\u30b0\u30e9\u30e0\uff08\u30c7\u30fc\u30e2\u30f3\uff09\u3068\u3057\u3066\u5f85\u3061\u69cb\u3048\u3001\u30ad\u30e5\u30fc\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30ad\u30e5\u30fc\u306e\u7a2e\u985e\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>php artisan queue:work <strong>redis<\/strong><\/pre>\n<p>\u6307\u5b9a\u3067\u304d\u308b\u306e\u306f\u3001\u300cconfig\/queue.php\u300d\u5185\u306econnections\u306e\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h2>\u540d\u524d\u3092\u6307\u5b9a\u3057\u3066\u30ad\u30e5\u30fc\u3092\u5b9f\u884c\u3059\u308b\uff08&#8211;queue\uff09<\/h2>\n<pre>php artisan queue:work <strong>--queue=high,low<\/strong><\/pre>\n<p>\u4f8b\u3048\u3070\u3001\u512a\u5148\u5ea6\u304c\u9ad8\u3044\u300chigh\u300d\u3084\u305d\u306e\u9006\u306e\u300clow\u300d\u306a\u3069\u30ad\u30e5\u30fc\u306b\u306f\u540d\u524d\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u3053\u306e\u4e2d\u304b\u3089\u5fc5\u8981\u306a\u3082\u306e\u3060\u3051\u3092\u6307\u5b9a\u3057\u3066\u30ad\u30e5\u30fc\u3092\u5b9f\u884c\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u3001\u300cdefault\u300d<\/p>\n<h2>\u6b21\u306e\u30ad\u30e5\u30fc\u3092\u3072\u3068\u3064\u3060\u3051\u5b9f\u884c\u3059\u308b\uff08&#8211;once\uff09<\/h2>\n<pre>php artisan queue:work <strong>--once<\/strong><\/pre>\n<h2>\u5931\u6557\u30ad\u30e5\u30fc\u3092\u9045\u3089\u305b\u308b\uff08&#8211;delay\uff09<\/h2>\n<pre>php artisan queue:work <strong>--delay=10<\/strong><\/pre>\n<p>\u6307\u5b9a\u3059\u308b\u306e\u306f\u79d2\u6570\u3002<\/p>\n<h2>\u30e1\u30f3\u30c6\u30f3\u30ca\u30f3\u30b9\u30fb\u30e2\u30fc\u30c9\u3067\u3082\u30ad\u30e5\u30fc\u3092\u5b9f\u884c\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<pre>php artisan queue:work <strong>--force<\/strong><\/pre>\n<h2>\u6700\u5927\u30e1\u30e2\u30ea\u30fc\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;memroy\uff09<\/h2>\n<pre>php artisan queue:work <strong>--memory=128<\/strong><\/pre>\n<p>\u6307\u5b9a\u3059\u308b\u5358\u4f4d\u306f\u30e1\u30ac\u30d0\u30a4\u30c8\u3002<\/p>\n<h2>\u30ad\u30e5\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u304d\u306e\u30b9\u30ea\u30fc\u30d7\u79d2\u6570\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;sleep\uff09<\/h2>\n<pre>php artisan queue:work <strong>--sleep=5<\/strong><\/pre>\n<h2>\u5b50\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3067\u304d\u308b\u6700\u5927\u79d2\u6570\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;timeout\uff09<\/h2>\n<pre>php artisan queue:work <strong>--timeout=120<\/strong><\/pre>\n<h2>\u5931\u6557\u30ad\u30e5\u30fc\u3068\u307f\u306a\u3059\u307e\u3067\u306e\u5b9f\u884c\u56de\u6570\u3092\u6307\u5b9a\u3059\u308b\uff08&#8211;tries\uff09<\/h2>\n<pre>php artisan queue:work <strong>--tries=3<\/strong><\/pre>\n<h1>Route\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\uff08route:cache\uff09<\/h1>\n<pre><strong>php artisan route:cache<\/strong><\/pre>\n<p>\u300cbootstrap\/cache\/routes.php\u300d\u306bRoute\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3057\u3001\u30da\u30fc\u30b8\u8868\u793a\u3092\u9ad8\u901f\u5316\u3057\u307e\u3059\u3002<\/p>\n<h1>Route\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08route:clear\uff09<\/h1>\n<pre><strong>php artisan route:clear<\/strong><\/pre>\n<p>\u524d\u9805\u76ee\u306e\u300croute:cache\u300d\u3067\u4f5c\u6210\u3055\u308c\u305f\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<h1>Route\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3059\u308b\uff08route:list\uff09<\/h1>\n<pre><strong>php artisan route:list<\/strong><\/pre>\n<h2>HTTP\u30e1\u30bd\u30c3\u30c9\u3067\u7d5e\u308a\u8fbc\u3080\uff08&#8211;method\uff09<\/h2>\n<pre>php artisan route:list <strong>--method=post<\/strong><\/pre>\n<p>\u300cget\u300d\u300cpost\u300d\u300cput\u300d\u300cdelete\u300d\u306a\u3069\u306eHTTP\u30e1\u30bd\u30c3\u30c9\u3067\u8868\u793a\u30ea\u30b9\u30c8\u3092\u7d5e\u308a\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<h2>Route\u540d\u3067\u7d5e\u308a\u8fbc\u3080\uff08&#8211;name\uff09<\/h2>\n<pre>php artisan route:list <strong>--name=logout<\/strong><\/pre>\n<h2>Route\u30ea\u30b9\u30c8\u306e\u8868\u793a\u9806\u3092\u9006\u306b\u3059\u308b\uff08&#8211;reverse\uff09<\/h2>\n<pre>php artisan route:list <strong>--reverse<\/strong><\/pre>\n<h1>\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3092\u5b9f\u884c\u3059\u308b\uff08schedule:run\uff09<\/h1>\n<pre><strong>php artisan schedule:run<\/strong><\/pre>\n<h1>\u30bb\u30c3\u30b7\u30e7\u30f3\u7528\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\uff08session:table\uff09<\/h1>\n<pre>php artisan <strong>session:table<\/strong><\/pre>\n<p>\u305f\u3060\u3057\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u300cphp artisan migrate\u300d\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u3082\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u516c\u958b\u30b9\u30c8\u30ec\u30fc\u30b8\u30d5\u30a1\u30a4\u30eb\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\uff08storage:link\uff09<\/h1>\n<pre><strong>php artisan storage:link<\/strong><\/pre>\n<p>Laravel\u3067\u306f\u300cstorage\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u7ba1\u5eab\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u30d5\u30a9\u30eb\u30c0\u5185\u3078\u306e\u516c\u958b\u30a8\u30ea\u30a2\u3092\u4f5c\u6210\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u753b\u50cf\u306a\u3069\u3092\u30a6\u30a7\u30d6\u4e0a\u306b\u516c\u958b\u3059\u308b\u5834\u5408\u3067\u3059\uff09<\/p>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u300cpublic\u300d\u30d5\u30a9\u30eb\u30c0\u306b\u300cstorage\u300d\u3068\u3044\u3046\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\uff08\u3042\u305f\u304b\u3082\u30d5\u30a9\u30eb\u30c0\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u305b\u308b\u30ea\u30f3\u30af\uff09\u304c\u4f5c\u6210\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4f8b\u3048\u3070\u300chttps:\/\/example.comt\/storage\/*****.jpg\u300d\u3068\u3044\u3046\u98a8\u306b\u30d5\u30a1\u30a4\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d5\u30a1\u30a4\u30eb\u3092Publish\u3059\u308b\uff08vendor:publish\uff09<\/h1>\n<pre><strong>php artisan vendor:publish<\/strong><\/pre>\n<p>\u4f8b\u3048\u3070\u3001\u3042\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3082\u3064config\u30d5\u30a1\u30a4\u30eb\u306fvendor\u30d5\u30a1\u30eb\u30c0\u306e\u4e2d\u306b\u8a2d\u7f6e\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u76f4\u63a5\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u306a\u305c\u306a\u3089\u3001\u4eca\u5f8c\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u5909\u66f4\u5185\u5bb9\u304c\u5931\u308f\u308c\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u3053\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u306fPublish\uff08\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u3082\u3044\u3044\u30d5\u30a9\u30eb\u30c0\u306b\u30b3\u30d4\u30fc\uff09\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u305d\u308c\u3092\u5b9f\u884c\u3067\u304d\u308b\u306e\u304c\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u904e\u53bb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306eLaravel\u3067\u306f\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u304cPublish\u3055\u308c\u3066\u307e\u3057\u305f\u304c\u3001\u73fe\u5728\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u9078\u3076\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-818\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/vendor_publish.png\" alt=\"\" width=\"637\" height=\"240\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/vendor_publish.png 637w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/07\/vendor_publish-300x113.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/p>\n<h2>\u5f37\u5236\u7684\u306b\u4e0a\u66f8\u304d\u3059\u308b\uff08&#8211;force\uff09<\/h2>\n<pre>php artisan vendor:publish <strong>--force<\/strong><\/pre>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u3059\u3067\u306bPublish\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u30b9\u30ad\u30c3\u30d7\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u300c&#8211;force\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u5f37\u5236\u7684\u306b\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u4eca\u307e\u3067\u306e\u5909\u66f4\u306f\u5168\u3066\u5931\u308f\u308c\u308b\uff09<\/p>\n<h2>\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092Publish\u3059\u308b\uff08&#8211;all\uff09<\/h2>\n<pre>php artisan vendor:publish <strong>--all<\/strong><\/pre>\n<p>\u9078\u629e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8868\u793a\u3055\u305b\u305a\u3001\u7121\u6761\u4ef6\u3067\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092Publish\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h2>\u30bf\u30b0\u3092\u6307\u5b9a\u3057\u3066Publish\u3059\u308b\uff08&#8211;tag\uff09<\/h2>\n<pre>php artisan vendor:publish <strong>--tag=migrations<\/strong><\/pre>\n<h1>\u30d3\u30e5\u30fc\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3059\u308b\uff08view:cache\uff09<\/h1>\n<pre><strong>php artisan view:cache<\/strong><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u300cstorage\/framework\/views\u300d\u5185\u306b\u5168\u30d3\u30e5\u30fc\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\uff08\u3064\u307e\u308a\u3001Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092HTML\uff06PHP\u5316\u3057\u305f\u3082\u306e\uff09\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30da\u30fc\u30b8\u8868\u793a\u306e\u9ad8\u901f\u5316\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>\u30d3\u30e5\u30fc\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\uff08view:clear\uff09<\/h1>\n<pre><strong>php artisan view:clear<\/strong><\/pre>\n<p>\u524d\u9805\u76ee\u3067\u4f5c\u6210\u3055\u308c\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u524a\u9664\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u4eca\u56de\u3001\u5168\u3066\u306eartisan\u30b3\u30de\u30f3\u30c9\u3092\u307e\u3068\u3081\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u500b\u4eba\u7684\u306b\u3082\u4eca\u307e\u3067\u77e5\u3089\u306a\u3044\u3082\u306e\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u6c17\u304c\u4ed8\u304d\u307e\u3057\u305f\u3002\u304d\u3063\u3068\u4eca\u5f8c\u306e\u958b\u767a\u3067\u751f\u7523\u6027\u3092\u3042\u3052\u3089\u308c\u308b\u3053\u3068\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307f\u306a\u3055\u3093\u3082\u305c\u3072\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-519 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/21.png\" alt=\"\" width=\"192\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/21.png 192w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/05\/21-180x300.png 180w\" sizes=\"auto, (max-width: 192px) 100vw, 192px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u6700\u8fd1\u306f\u300cLaravel\u306e\u4e3b\u8981\u306a\u6a5f\u80fd\u3092\u518d\u30c1\u30a7\u30c3\u30af\u300d\u3059\u308b\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306b\u3088\u3063\u3066\u898b\u9003\u3057\u3066\u3044\u305f\u6a5f\u80fd\u3084\u3001\u3088\u308a\u77ed\u3044\u30b3\u30fc\u30c9\u3067\u306e\u5b9f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=768\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u516868\u7a2e\u985e\uff01Laravel 5.6\u306eartisan\u30b3\u30de\u30f3\u30c9\u307e\u3068\u3081&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":822,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[50],"class_list":["post-768","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-50"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/768","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=768"}],"version-history":[{"count":22,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/768\/revisions"}],"predecessor-version":[{"id":821,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/768\/revisions\/821"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/822"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}