Completed
Push — master ( f098ed...4b87ed )
by Vasyl
03:52
created
src/SlugMakerServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             __DIR__.'/../config/slugmaker.php' => $this->app->configPath().'/slugmaker.php',
14 14
         ], 'config');
15 15
 
16
-        if (! class_exists('CreateSlugsTable')) {
16
+        if (!class_exists('CreateSlugsTable')) {
17 17
             $timestamp = date('Y_m_d_His', time());
18 18
 
19 19
             $this->publishes([
Please login to merge, or discard this patch.
src/Models/SlugModelScopesTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
     public function scopeByTypesByNames($query, array $attributes)
8 8
     {
9 9
         foreach ($attributes as $type => $slugs) {
10
-            if (! empty($slugs)) {
10
+            if (!empty($slugs)) {
11 11
                 $names = is_array($slugs) ? $slugs : [$slugs];
12 12
                 $query->orWhere('slugable_type', $type)->whereIn('name', $names);
13 13
             }
Please login to merge, or discard this patch.
src/SlugMakerTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
      */
37 37
     protected static function bootSlugMakerTrait()
38 38
     {
39
-        static::created(function (Model $model) {
39
+        static::created(function(Model $model) {
40 40
             $model->generateSlugOnCreate();
41 41
         });
42 42
 
43
-        static::updated(function (Model $model) {
43
+        static::updated(function(Model $model) {
44 44
             $model->generateSlugOnUpdate();
45 45
         });
46 46
 
47
-        static::deleted(function (Model $model) {
47
+        static::deleted(function(Model $model) {
48 48
             $model->removeSlugsOnDeleted();
49 49
         });
50 50
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $this->slugOptions = $this->getSlugMakerOptions();
68 68
 
69
-        if (! $this->slugOptions->generateSlugsOnCreate) {
69
+        if (!$this->slugOptions->generateSlugsOnCreate) {
70 70
             return;
71 71
         }
72 72
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $this->slugOptions = $this->getSlugMakerOptions();
83 83
 
84
-        if (! $this->slugOptions->generateSlugsOnUpdate) {
84
+        if (!$this->slugOptions->generateSlugsOnUpdate) {
85 85
             return;
86 86
         }
87 87
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         }
157 157
 
158 158
         $slugSourceString = collect($this->slugOptions->generateSlugFrom)
159
-            ->map(function (string $fieldName) : string {
159
+            ->map(function(string $fieldName) : string {
160 160
                 return $this->$fieldName ?? '';
161 161
             })
162 162
             ->implode('-');
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
      */
195 195
     protected function guardAgainstInvalidSlugOptions()
196 196
     {
197
-        if (! count($this->slugOptions->generateSlugFrom)) {
197
+        if (!count($this->slugOptions->generateSlugFrom)) {
198 198
             throw InvalidOption::missingFromField();
199 199
         }
200 200
 
201
-        if (! strlen($this->slugField)) {
201
+        if (!strlen($this->slugField)) {
202 202
             throw InvalidOption::missingSlugField();
203 203
         }
204 204
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
         $slugs = is_array($slug) ? $slug : [$slug];
236 236
 
237
-        return $query->whereHas('slug', function ($q) use ($slugs) {
237
+        return $query->whereHas('slug', function($q) use ($slugs) {
238 238
             $q->whereIn($this->slugField, $slugs);
239 239
         });
240 240
     }
Please login to merge, or discard this patch.