@@ -57,15 +57,15 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | // Publish Config File |
| 59 | 59 | $this->publishes([ |
| 60 | - __DIR__ . '/../../config/announcement.php' => config_path('announcement.php'), |
|
| 60 | + __DIR__.'/../../config/announcement.php' => config_path('announcement.php'), |
|
| 61 | 61 | ], 'announcement-config'); |
| 62 | 62 | // Publish View Files |
| 63 | 63 | $this->publishes([ |
| 64 | - __DIR__ . '/../../resources/views' => resource_path('views/vendor/adminetic/plugin/announcement'), |
|
| 64 | + __DIR__.'/../../resources/views' => resource_path('views/vendor/adminetic/plugin/announcement'), |
|
| 65 | 65 | ], 'announcement-views'); |
| 66 | 66 | // Publish Migration Files |
| 67 | 67 | $this->publishes([ |
| 68 | - __DIR__ . '/../../database/migrations' => database_path('migrations'), |
|
| 68 | + __DIR__.'/../../database/migrations' => database_path('migrations'), |
|
| 69 | 69 | ], 'announcement-migrations'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | protected function registerResource() |
| 78 | 78 | { |
| 79 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); // Loading Migration Files |
|
| 80 | - $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'announcement'); // Loading Views Files |
|
| 79 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); // Loading Migration Files |
|
| 80 | + $this->loadViewsFrom(__DIR__.'/../../resources/views', 'announcement'); // Loading Views Files |
|
| 81 | 81 | $this->registerRoutes(); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | protected function registerRoutes() |
| 90 | 90 | { |
| 91 | - Route::group($this->routeConfiguration(), function () { |
|
| 92 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/web.php'); |
|
| 91 | + Route::group($this->routeConfiguration(), function() { |
|
| 92 | + $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
|
| 93 | 93 | }); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | return [ |
| 104 | 104 | 'prefix' => config('announcement.prefix', 'admin'), |
| 105 | - 'middleware' => config('announcement.middleware', ['web', 'auth']), |
|
| 105 | + 'middleware' => config('announcement.middleware', [ 'web', 'auth' ]), |
|
| 106 | 106 | ]; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -11,18 +11,18 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | use LogsActivity; |
| 13 | 13 | |
| 14 | - protected $guarded = []; |
|
| 14 | + protected $guarded = [ ]; |
|
| 15 | 15 | |
| 16 | 16 | // Forget cache on updating or saving and deleting |
| 17 | 17 | public static function boot() |
| 18 | 18 | { |
| 19 | 19 | parent::boot(); |
| 20 | 20 | |
| 21 | - static::saving(function () { |
|
| 21 | + static::saving(function() { |
|
| 22 | 22 | self::cacheKey(); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - static::deleting(function () { |
|
| 25 | + static::deleting(function() { |
|
| 26 | 26 | self::cacheKey(); |
| 27 | 27 | }); |
| 28 | 28 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | protected static $logName = 'announcement'; |
| 38 | 38 | |
| 39 | 39 | // Appends |
| 40 | - protected $appends = ['audience_names', 'color']; |
|
| 40 | + protected $appends = [ 'audience_names', 'color' ]; |
|
| 41 | 41 | |
| 42 | 42 | // Casts |
| 43 | 43 | protected $casts = [ |
@@ -59,19 +59,19 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function getColorAttribute() |
| 61 | 61 | { |
| 62 | - $colors = ['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'pink', 'grey']; |
|
| 62 | + $colors = [ 'primary', 'secondary', 'success', 'info', 'warning', 'danger', 'pink', 'grey' ]; |
|
| 63 | 63 | |
| 64 | - return $colors[array_rand($colors, 1)]; |
|
| 64 | + return $colors[ array_rand($colors, 1) ]; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function mediums() |
| 68 | 68 | { |
| 69 | 69 | if (isset($this->medium)) { |
| 70 | 70 | foreach ($this->medium as $val) { |
| 71 | - $mediums[] = [ |
|
| 71 | + $mediums[ ] = [ |
|
| 72 | 72 | 1 => 'database', |
| 73 | 73 | 2 => 'mail', |
| 74 | - ][$val]; |
|
| 74 | + ][ $val ]; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $mediums; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function via($notifiable) |
| 34 | 34 | { |
| 35 | - return ['slack']; |
|
| 35 | + return [ 'slack' ]; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | public function toSlack($notifiable) |
| 45 | 45 | { |
| 46 | 46 | return (new SlackMessage) |
| 47 | - ->from(setting('title', config('adminetic.title', 'Adminetic')) . ' - ' . $this->announcement->user->name ?? 'N/A') |
|
| 47 | + ->from(setting('title', config('adminetic.title', 'Adminetic')).' - '.$this->announcement->user->name ?? 'N/A') |
|
| 48 | 48 | ->image(getLogo()) |
| 49 | 49 | ->content((new HtmlConverter())->convert($this->announcement->body)); |
| 50 | 50 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function handle(AnnouncementMadeEvent $event) |
| 20 | 20 | { |
| 21 | 21 | if (isset($event->announcement)) { |
| 22 | - $audiences = User::find($event->announcement->audience); |
|
| 22 | + $audiences = User::find($event->announcement->audience); |
|
| 23 | 23 | Notification::send($audiences, new AnnouncementNotification($event->announcement)); |
| 24 | 24 | if ($event->announcement->slack_notify) { |
| 25 | 25 | $audiences->first()->setSlackUrl(env('SLACK_WEBHOOK', null))->notify(new SlackAnnouncementNotification($event->announcement)); |