From 7de1da681dbaf6e259c7bc8aa91f7a4a505564df Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 2 Apr 2020 15:45:28 +0800 Subject: [PATCH] Add class based events. Signed-off-by: Mior Muhammad Zaki --- src/Events/AuthorizationCreated.php | 18 ++++++++++++++++++ src/Events/Event.php | 8 ++++++++ src/Events/InstallationCompleted.php | 2 +- src/Events/SchemaCreated.php | 8 ++++++++ src/Installation.php | 3 +++ src/Listeners/MigrateDatabaseSchema.php | 6 +++--- 6 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 src/Events/AuthorizationCreated.php create mode 100644 src/Events/Event.php create mode 100644 src/Events/SchemaCreated.php diff --git a/src/Events/AuthorizationCreated.php b/src/Events/AuthorizationCreated.php new file mode 100644 index 0000000..55d3d1b --- /dev/null +++ b/src/Events/AuthorizationCreated.php @@ -0,0 +1,18 @@ +acl = $acl; + } +} diff --git a/src/Events/Event.php b/src/Events/Event.php new file mode 100644 index 0000000..e0faef3 --- /dev/null +++ b/src/Events/Event.php @@ -0,0 +1,8 @@ +foundation(); + + \event(new SchemaCreated()); \event('orchestra.install.schema'); return true; diff --git a/src/Listeners/MigrateDatabaseSchema.php b/src/Listeners/MigrateDatabaseSchema.php index 18bcbe0..ba4e6d9 100644 --- a/src/Listeners/MigrateDatabaseSchema.php +++ b/src/Listeners/MigrateDatabaseSchema.php @@ -3,18 +3,18 @@ namespace Orchestra\Installation\Listeners; use Illuminate\Support\Facades\Artisan; -use Orchestra\Installation\Events\InstallationCompleted; +use Orchestra\Installation\Events\Event; class MigrateDatabaseSchema { /** * Handle the event. * - * @param \Orchestra\Installation\Events\InstallationCompleted $event + * @param \Orchestra\Installation\Events\Event $event * * @return void */ - public function handle(InstallationCompleted $event) + public function handle(Event $event) { Artisan::call('migrate', ['--force' => true]); }