From 52f537b59483b043a7c8a55fb9592365b33532ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20Thernstr=C3=B6m?= Date: Wed, 24 Apr 2024 19:42:59 +0200 Subject: [PATCH] =?UTF-8?q?Kommando=20f=C3=B6r=20att=20lista=20senaste=20h?= =?UTF-8?q?=C3=A4ndelserna?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/CreateAISummary.php | 1 - app/Console/Commands/ListEvents.php | 36 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/Console/Commands/ListEvents.php diff --git a/app/Console/Commands/CreateAISummary.php b/app/Console/Commands/CreateAISummary.php index e77c2620..8b23e7db 100644 --- a/app/Console/Commands/CreateAISummary.php +++ b/app/Console/Commands/CreateAISummary.php @@ -4,7 +4,6 @@ use App\CrimeEvent; use Illuminate\Console\Command; -use MO; class CreateAISummary extends Command { /** diff --git a/app/Console/Commands/ListEvents.php b/app/Console/Commands/ListEvents.php new file mode 100644 index 00000000..74986d01 --- /dev/null +++ b/app/Console/Commands/ListEvents.php @@ -0,0 +1,36 @@ +line('Senaste händelserna:'); + + $events = CrimeEvent::select(['parsed_date', 'id', 'title'])->limit(10)->orderByDesc('parsed_date')->get(); + + $this->table(['Parsed date', 'ID', 'Title'], $events); + return Command::SUCCESS; + } +}