@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function up() |
16 | 16 | { |
17 | - Schema::create('announcements', function (Blueprint $table) { |
|
17 | + Schema::create('announcements', function(Blueprint $table) { |
|
18 | 18 | $table->id(); |
19 | 19 | $table->foreignId('user_id')->constrained()->cascadeOnDelete(); |
20 | 20 | $table->json('medium')->nullable(); |
@@ -15,4 +15,4 @@ |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | Route::resource('announcement', AnnouncementController::class); |
18 | -Route::get('timeline', [AnnouncementController::class, 'timeline']); |
|
18 | +Route::get('timeline', [ AnnouncementController::class, 'timeline' ]); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | public function indexAnnouncement() |
17 | 17 | { |
18 | 18 | $announcements = config('coderz.caching', true) |
19 | - ? (Cache::has('announcements') ? Cache::get('announcements') : Cache::rememberForever('announcements', function () { |
|
19 | + ? (Cache::has('announcements') ? Cache::get('announcements') : Cache::rememberForever('announcements', function() { |
|
20 | 20 | return Announcement::latest()->get(); |
21 | 21 | })) |
22 | 22 | : Announcement::latest()->get(); |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | public function markAsRead(Announcement $announcement) |
77 | 77 | { |
78 | 78 | foreach (auth()->user()->unreadNotifications as $unread_notification) { |
79 | - if ($unread_notification->data['id'] != null) { |
|
80 | - if ($unread_notification->data['id'] == $announcement->id) { |
|
79 | + if ($unread_notification->data[ 'id' ] != null) { |
|
80 | + if ($unread_notification->data[ 'id' ] == $announcement->id) { |
|
81 | 81 | $unread_notification->markAsRead(); |
82 | - $unread_notification->update(['read_at' => now()]); |
|
82 | + $unread_notification->update([ 'read_at' => now() ]); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | protected function registerRoutes() |
90 | 90 | { |
91 | - Route::group($this->routeConfiguration(), function () { |
|
91 | + Route::group($this->routeConfiguration(), function() { |
|
92 | 92 | $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
93 | 93 | }); |
94 | 94 | } |
@@ -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 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ], |
55 | 55 | ], |
56 | 56 | 'children' => array_merge( |
57 | - [[ |
|
57 | + [ [ |
|
58 | 58 | 'type' => 'submenu', |
59 | 59 | 'name' => 'Timeline', |
60 | 60 | 'is_active' => request()->routeIs('timeline') ? 'active' : '', |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'condition' => auth()->user()->can('view-any', Announcement::class), |
66 | 66 | ], |
67 | 67 | ], |
68 | - ]], |
|
68 | + ] ], |
|
69 | 69 | $this->indexCreateChildren('announcement', Announcement::class) |
70 | 70 | ), |
71 | 71 | ], |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | public function handle() |
39 | 39 | { |
40 | 40 | $this->call('vendor:publish', [ |
41 | - '--tag' => ['adminetic-config'], |
|
41 | + '--tag' => [ 'adminetic-config' ], |
|
42 | 42 | ]); |
43 | 43 | $this->info('Adminetic config file published ... ✅'); |
44 | 44 | $this->call('vendor:publish', [ |
45 | - '--tag' => ['adminetic-assets-files'], |
|
45 | + '--tag' => [ 'adminetic-assets-files' ], |
|
46 | 46 | ]); |
47 | 47 | $this->info('Adminetic asset files published ... ✅'); |
48 | 48 | $this->call('vendor:publish', [ |
49 | - '--tag' => ['adminetic-static-files'], |
|
49 | + '--tag' => [ 'adminetic-static-files' ], |
|
50 | 50 | ]); |
51 | 51 | $this->info('Adminetic static files published ... ✅'); |
52 | 52 | $this->addMyMenu(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $modelTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyMenu.stub'); |
76 | 76 | |
77 | - if (! file_exists($path = app_path('Services'))) { |
|
77 | + if (!file_exists($path = app_path('Services'))) { |
|
78 | 78 | mkdir($path, 0777, true); |
79 | 79 | } |
80 | 80 | |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | $myDashboardTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyDashboard.stub'); |
93 | 93 | $myDashboardIndexTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/DashboardIndex.stub'); |
94 | 94 | |
95 | - if (! file_exists($path = app_path('Services'))) { |
|
95 | + if (!file_exists($path = app_path('Services'))) { |
|
96 | 96 | mkdir($path, 0777, true); |
97 | 97 | } |
98 | - if (! file_exists($path = resource_path('views/admin/dashboard'))) { |
|
98 | + if (!file_exists($path = resource_path('views/admin/dashboard'))) { |
|
99 | 99 | mkdir($path, 0777, true); |
100 | 100 | } |
101 | - if (! file_exists($path = resource_path('views/admin/layouts/modules/dashboard'))) { |
|
101 | + if (!file_exists($path = resource_path('views/admin/layouts/modules/dashboard'))) { |
|
102 | 102 | mkdir($path, 0777, true); |
103 | 103 | } |
104 | 104 | $myDashboardIndexfile = resource_path('views/admin/dashboard/index.blade.php'); |
@@ -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 @@ |
||
32 | 32 | */ |
33 | 33 | public function via($notifiable) |
34 | 34 | { |
35 | - return ['slack']; |
|
35 | + return [ 'slack' ]; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |