generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d77fab
commit 7aaba63
Showing
10 changed files
with
101 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
return [ | ||
/** | ||
* Channels should be added in the following format: | ||
* 'channels' => [ | ||
* 'channel_name' => [ | ||
* 'driver' => 'driver_name', | ||
* 'options' => [] | ||
* ] | ||
* ] | ||
*/ | ||
'channels' => [] | ||
]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Ibrahemkamal\OmniMessaging\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @see \Ibrahemkamal\OmniMessaging\OmniMessaging | ||
* @method static \Ibrahemkamal\OmniMessaging\Contracts\MessagingDriverContract driver(string $driverName) | ||
* | ||
*/ | ||
class OmniMessaging extends Facade | ||
{ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return \Ibrahemkamal\OmniMessaging\OmniMessaging::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Ibrahemkamal\OmniMessaging; | ||
|
||
use Ibrahemkamal\OmniMessaging\Contracts\MessagingDriverContract; | ||
use Illuminate\Support\Manager; | ||
use InvalidArgumentException; | ||
|
||
class OmniMessaging extends Manager | ||
{ | ||
/** | ||
* Get the default driver name. | ||
* | ||
* | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function getDefaultDriver(): string | ||
{ | ||
throw new InvalidArgumentException('No Omni Messaging driver was specified.'); | ||
} | ||
|
||
protected function channel(MessagingDriverContract $channel) | ||
{ | ||
$name = $channel->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']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Ibrahemkamal\OmniMessaging; | ||
|
||
use Spatie\LaravelPackageTools\Package; | ||
use Spatie\LaravelPackageTools\PackageServiceProvider; | ||
|
||
class OmniMessagingServiceProvider extends PackageServiceProvider | ||
{ | ||
public function configurePackage(Package $package): void | ||
{ | ||
/* | ||
* This class is a Package Service Provider | ||
* | ||
* More info: https://github.com/spatie/laravel-package-tools | ||
*/ | ||
$package | ||
->name('omni-messaging') | ||
->hasConfigFile(); | ||
} | ||
|
||
public function registeringPackage(): void | ||
{ | ||
$this->app->singleton(\Ibrahemkamal\OmniMessaging\Facades\OmniMessaging::class, OmniMessaging::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
arch('it will not use debugging functions') | ||
->expect(['dd', 'dump', 'ray']) | ||
->each->not->toBeUsed(); |
This file was deleted.
Oops, something went wrong.