From a6e18c8cce634d514d154d16c2b19dbc26582682 Mon Sep 17 00:00:00 2001 From: Nasir Khan Saikat Date: Wed, 15 May 2024 16:16:52 +0600 Subject: [PATCH 1/2] ++ --- app/Console/Commands/ResetDemo.php | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/Console/Commands/ResetDemo.php diff --git a/app/Console/Commands/ResetDemo.php b/app/Console/Commands/ResetDemo.php new file mode 100644 index 00000000..98e49e19 --- /dev/null +++ b/app/Console/Commands/ResetDemo.php @@ -0,0 +1,52 @@ +warn("\n\n Demo Mode is ON \n"); + + $this->resetDemoData(); + } + else { + $this->warn("\n\n Demo Mode is OFF \n"); + } + } + + public function resetDemoData() + { + $this->info("Reset Database and migrate fresh"); + Artisan::call('migrate:fresh'); + + $this->info("Reset Database seeds"); + Artisan::call('db:seed'); + + $this->info("Insert Demo Data again"); + Artisan::call('laravel-starter:insert-demo-data'); + } +} From 29391227daf190aa910a2e4a974ee3b57810bc3a Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 15 May 2024 10:17:09 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- app/Console/Commands/ResetDemo.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/ResetDemo.php b/app/Console/Commands/ResetDemo.php index 98e49e19..849475b7 100644 --- a/app/Console/Commands/ResetDemo.php +++ b/app/Console/Commands/ResetDemo.php @@ -32,21 +32,20 @@ public function handle() $this->warn("\n\n Demo Mode is ON \n"); $this->resetDemoData(); - } - else { + } else { $this->warn("\n\n Demo Mode is OFF \n"); } } public function resetDemoData() { - $this->info("Reset Database and migrate fresh"); + $this->info('Reset Database and migrate fresh'); Artisan::call('migrate:fresh'); - $this->info("Reset Database seeds"); + $this->info('Reset Database seeds'); Artisan::call('db:seed'); - $this->info("Insert Demo Data again"); + $this->info('Insert Demo Data again'); Artisan::call('laravel-starter:insert-demo-data'); } }