diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index fe4cfe6..4b8f798 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -47,16 +47,6 @@ body: placeholder: 9.0.0 validations: required: true - - type: dropdown - id: operating-systems - attributes: - label: Which operating systems does with happen with? - description: You may select more than one. - multiple: true - options: - - macOS - - Windows - - Linux - type: textarea id: notes attributes: diff --git a/config/omni-messaging.php b/config/omni-messaging.php new file mode 100644 index 0000000..615a5da --- /dev/null +++ b/config/omni-messaging.php @@ -0,0 +1,14 @@ + [ + * 'channel_name' => [ + * 'driver' => 'driver_name', + * 'options' => [] + * ] + * ] + */ + 'channels' => [] +]; diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php deleted file mode 100644 index 82b58ab..0000000 --- a/database/factories/ModelFactory.php +++ /dev/null @@ -1,17 +0,0 @@ - - + tests diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/Facades/OmniMessaging.php b/src/Facades/OmniMessaging.php new file mode 100644 index 0000000..cddd15d --- /dev/null +++ b/src/Facades/OmniMessaging.php @@ -0,0 +1,18 @@ +getChannelName(); + $channel = config("omni-messaging.channels.$name"); + if (!$channel) { + throw new InvalidArgumentException("Omni Messaging channel [$name] is not defined."); + } + if (!isset($channel['driver'])) { + throw new InvalidArgumentException("Omni Messaging channel [$name] driver is not defined."); + } + if (!isset($channel['options'])) { + throw new InvalidArgumentException("Omni Messaging channel [$name] options is not defined."); + } + return $this->driver($channel['driver']); + } +} diff --git a/src/OmniMessagingServiceProvider.php b/src/OmniMessagingServiceProvider.php new file mode 100644 index 0000000..289015e --- /dev/null +++ b/src/OmniMessagingServiceProvider.php @@ -0,0 +1,26 @@ +name('omni-messaging') + ->hasConfigFile(); + } + + public function registeringPackage(): void + { + $this->app->singleton(\Ibrahemkamal\OmniMessaging\Facades\OmniMessaging::class, OmniMessaging::class); + } +} diff --git a/tests/ArchTest.php b/tests/ArchTest.php new file mode 100644 index 0000000..87fb64c --- /dev/null +++ b/tests/ArchTest.php @@ -0,0 +1,5 @@ +expect(['dd', 'dump', 'ray']) + ->each->not->toBeUsed(); diff --git a/workbench/app/Providers/WorkbenchServiceProvider.php b/workbench/app/Providers/WorkbenchServiceProvider.php deleted file mode 100644 index 001d06d..0000000 --- a/workbench/app/Providers/WorkbenchServiceProvider.php +++ /dev/null @@ -1,25 +0,0 @@ -