love_php/routes/console.php

31 lines
940 B
PHP
Raw Permalink Normal View History

2026-04-02 09:20:51 +08:00
<?php
use Illuminate\Foundation\Inspiring;
use App\Events\ChatMessages;
use App\Events\News;
use App\Models\User;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');
Artisan::command('chatMessage', function () {
event(new ChatMessages(User::find(64)));
$this->comment("news sent");
})->describe('Send news');
Artisan::command('bignews', function () {
broadcast(new News(date('Y-m-d h:i:s A').": BIG NEWS!"));
$this->comment("news sent");
})->describe('Send news');