顯示具有 Lumen 標籤的文章。 顯示所有文章
顯示具有 Lumen 標籤的文章。 顯示所有文章

2024/01/24

Lumen 撰寫類似Laravel 產生序號Command

Console/Kernel配置:
<?php

namespace App\Console;

use App\Console\Commands\GenerateKeyCommand;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        GenerateKeyCommand::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //
    }
}