@@ -80,7 +80,7 @@ |
||
80 | 80 | */ |
81 | 81 | public function isTemporary(): bool |
82 | 82 | { |
83 | - return ! $this->isPermanent(); |
|
83 | + return !$this->isPermanent(); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function scopeWhereTaggable(Builder $query, $taggable): Builder |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Imanghafoori\Tags\Services\TagService; |
4 | 4 | |
5 | -if (! function_exists('tempTags')) { |
|
5 | +if (!function_exists('tempTags')) { |
|
6 | 6 | function tempTags($model): TagService |
7 | 7 | { |
8 | 8 | $tagService = new TagService(); |
@@ -23,43 +23,43 @@ discard block |
||
23 | 23 | { |
24 | 24 | $this->registerConsoleCommands(); |
25 | 25 | |
26 | - Builder::macro('hasActiveTempTags', function ($title) { |
|
26 | + Builder::macro('hasActiveTempTags', function($title) { |
|
27 | 27 | $table = $this->getModel()->getTable(); |
28 | - if (! in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
28 | + if (!in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
29 | 29 | TempTagServiceProvider::$registeredRelation[] = $table; |
30 | 30 | Relation::morphMap([ |
31 | 31 | $table => get_class($this->getModel()), |
32 | 32 | ]); |
33 | 33 | } |
34 | 34 | |
35 | - return $this->whereHas('activeTempTags', function ($q) use ($title) { |
|
35 | + return $this->whereHas('activeTempTags', function($q) use ($title) { |
|
36 | 36 | $q->whereIn('title', (array) $title); |
37 | 37 | }); |
38 | 38 | }); |
39 | 39 | |
40 | - Builder::macro('hasExpiredTempTags', function ($title) { |
|
40 | + Builder::macro('hasExpiredTempTags', function($title) { |
|
41 | 41 | $table = $this->getModel()->getTable(); |
42 | - if (! in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
42 | + if (!in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
43 | 43 | TempTagServiceProvider::$registeredRelation[] = $table; |
44 | 44 | Relation::morphMap([ |
45 | 45 | $table => get_class($this->getModel()), |
46 | 46 | ]); |
47 | 47 | } |
48 | 48 | |
49 | - return $this->whereHas('expiredTempTags', function ($q) use ($title) { |
|
49 | + return $this->whereHas('expiredTempTags', function($q) use ($title) { |
|
50 | 50 | $q->whereIn('title', (array) $title); |
51 | 51 | }); |
52 | 52 | }); |
53 | 53 | |
54 | - Builder::macro('hasTempTags', function ($title) { |
|
54 | + Builder::macro('hasTempTags', function($title) { |
|
55 | 55 | $table = $this->getModel()->getTable(); |
56 | - if (! in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
56 | + if (!in_array($table, TempTagServiceProvider::$registeredRelation)) { |
|
57 | 57 | TempTagServiceProvider::$registeredRelation[] = $table; |
58 | 58 | |
59 | 59 | Relation::morphMap([$table => get_class($this->getModel())]); |
60 | 60 | } |
61 | 61 | |
62 | - return $this->whereHas('tempTags', function ($q) use ($title) { |
|
62 | + return $this->whereHas('tempTags', function($q) use ($title) { |
|
63 | 63 | $q->whereIn('title', (array) $title); |
64 | 64 | }); |
65 | 65 | }); |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | { |
118 | 118 | if ($this->app->runningInConsole()) { |
119 | 119 | $this->publishes([ |
120 | - __DIR__.'/../config/temp_tag.php' => config_path('tag.php'), |
|
120 | + __DIR__ . '/../config/temp_tag.php' => config_path('tag.php'), |
|
121 | 121 | ], 'tag-config'); |
122 | 122 | |
123 | 123 | $this->publishes([ |
124 | - __DIR__.'/../database/migrations' => database_path('migrations'), |
|
124 | + __DIR__ . '/../database/migrations' => database_path('migrations'), |
|
125 | 125 | ], 'migrations'); |
126 | 126 | } |
127 | 127 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | private function registerMigrations(): void |
137 | 137 | { |
138 | 138 | if ($this->app->runningInConsole() && $this->shouldLoadDefaultMigrations()) { |
139 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
139 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function configure(): void |
149 | 149 | { |
150 | - if (! $this->app->configurationIsCached()) { |
|
151 | - $this->mergeConfigFrom(__DIR__.'/../config/temp_tag.php', 'tag'); |
|
150 | + if (!$this->app->configurationIsCached()) { |
|
151 | + $this->mergeConfigFrom(__DIR__ . '/../config/temp_tag.php', 'tag'); |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | |
121 | 121 | private function fireEvent($event, $tag) |
122 | 122 | { |
123 | - ! $event && $event = 'tmp_tagged'; |
|
123 | + !$event && $event = 'tmp_tagged'; |
|
124 | 124 | |
125 | - $event .= ':'.$this->model->getTable().','.$tag->title; |
|
125 | + $event .= ':' . $this->model->getTable() . ',' . $tag->title; |
|
126 | 126 | |
127 | 127 | event($event, [$this->model, $tag]); |
128 | 128 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | private function deleteAll($tags) |
143 | 143 | { |
144 | - $tags->each(function ($tag) { |
|
144 | + $tags->each(function($tag) { |
|
145 | 145 | $tag->delete(); |
146 | 146 | }); |
147 | 147 | } |