{"id":8866,"date":"2020-07-03T10:00:00","date_gmt":"2020-07-03T01:00:00","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=8866"},"modified":"2020-07-02T16:16:01","modified_gmt":"2020-07-02T07:16:01","slug":"laravel%e3%83%90%e3%83%83%e3%83%81%e5%87%a6%e7%90%86%e3%81%ae%e3%82%bf%e3%82%b9%e3%82%af%e3%82%b9%e3%82%b1%e3%82%b8%e3%83%a5%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/8866","title":{"rendered":"[Laravel]\u30d0\u30c3\u30c1\u51e6\u7406\u306e\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb"},"content":{"rendered":"\n<p>\u4eca\u56de\u306fLaravel\u3067\u30d0\u30c3\u30c1\u51e6\u7406\u3092\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3067\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h4>\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308bPHP\u30af\u30e9\u30b9\u306e\u4f5c\u6210<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u4f5c\u6210\u3092\u304a\u3053\u306a\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan make:command BatchTest --command=\"batchtest\"<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u968e\u5c64\u306b\u300cBatchTest\u300d\u30af\u30e9\u30b9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app\/Console\/Commands\/BatchTest.php<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u3055\u308c\u305f\u30af\u30e9\u30b9\u306e\u4e2d\u8eab\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nnamespace App\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\n\nclass PointTest extends Command\n{\n    \/**\n     * The name and signature of the console command.\n     *\n     * @var string\n     *\/\n    protected $signature = 'batchtest';\n\n    \/**\n     * The console command description.\n     *\n     * @var string\n     *\/\n    protected $description = 'Command description';\n\n    \/**\n     * Create a new command instance.\n     *\n     * @return void\n     *\/\n    public function __construct()\n    {\n        parent::__construct();\n    }\n\n    \/**\n     * Execute the console command.\n     *\n     * @return mixed\n     *\/\n    public function handle()\n    {\n\n        \/\/\u3053\u3053\u306b\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\n\t\techo 'batch test';\n\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3059\u308b\u51e6\u7406\u306fhandle\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u5185\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u300cbatch test\u300d\u3092\u51fa\u529b\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u306b\u306fapp\/Console\/Kernel.php\u306b\u4e0a\u8a18\u306e\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n&lt;?php\n\nnamespace App\\Console;\n\nuse Illuminate\\Console\\Scheduling\\Schedule;\nuse Illuminate\\Foundation\\Console\\Kernel as ConsoleKernel;\n\nclass Kernel extends ConsoleKernel\n{\n    \/**\n     * The Artisan commands provided by your application.\n     *\n     * @var array\n     *\/\n    protected $commands = [\n\t\n        \/\/\u3053\u3053\u306b\u4f5c\u6210\u3057\u305f\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\n        \\App\\Console\\Commands\\BatchTest::class,\n    \n\t];\n\n    \/**\n     * Define the application's command schedule.\n     *\n     * @param  \\Illuminate\\Console\\Scheduling\\Schedule  $schedule\n     * @return void\n     *\/\n    protected function schedule(Schedule $schedule)\n    {\n        \/\/ $schedule->command('inspire')\n        \/\/          ->hourly();\n\n    }\n\n    \/**\n     * Register the commands for the application.\n     *\n     * @return void\n     *\/\n    protected function commands()\n    {\n        $this->load(__DIR__.'\/Commands');\n\n        require base_path('routes\/console.php');\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u306e\u8ffd\u52a0\u304c\u3067\u304d\u305f\u3089\u3001\u5b9f\u969b\u306b\u30b3\u30de\u30f3\u30c9\u304b\u3089\u5b9f\u884c\u3067\u304d\u308b\u304b\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ php artisan batchtest\nbatch test<\/code><\/pre>\n\n\n\n<p>\u7121\u4e8b\u3001\u5b9f\u884c\u3067\u304d\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<br><br> \u6b21\u56de\u306fLinux\u306ecrontab\u306b\u767b\u9332\u3092\u304a\u3053\u306a\u3044\u3001\u6307\u5b9a\u3057\u305f\u65e5\u6642\u306b\u81ea\u52d5\u7684\u306b\u30d0\u30c3\u30c1\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u91d1\u66dc\u65e5\u62c5\u5f53\uff1a nishida<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8866\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/8866\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"[Laravel]\u30d0\u30c3\u30c1\u51e6\u7406\u306e\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8866\" data-text=\"[Laravel]\u30d0\u30c3\u30c1\u51e6\u7406\u306e\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8866\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8866\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306fLaravel\u3067\u30d0\u30c3\u30c1\u51e6\u7406\u3092\u30bf\u30b9\u30af\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3067\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8866"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=8866"}],"version-history":[{"count":4,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8866\/revisions"}],"predecessor-version":[{"id":8872,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8866\/revisions\/8872"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=8866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=8866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=8866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}