2023-03-17 14:33:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Inspiring;
|
|
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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 () {
|
2023-04-07 14:58:45 +00:00
|
|
|
|
|
|
|
$activity = Spatie\Activitylog\Models\Activity::latest()->first();
|
|
|
|
|
|
|
|
$this->info(
|
|
|
|
collect(
|
|
|
|
json_decode(data_get($activity, 'description'), associative: true, flags: JSON_THROW_ON_ERROR)
|
|
|
|
)
|
|
|
|
->sortBy('order')
|
|
|
|
->map(fn($i) => $i['output'])
|
|
|
|
->implode("\n")
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-17 14:33:48 +00:00
|
|
|
})->purpose('Display an inspiring quote');
|