@@ -49,7 +49,7 @@ |
||
49 | 49 | ->byNamesByClass($slugs, $modelClass) |
50 | 50 | ->get(); |
51 | 51 | |
52 | - return $slugs->map(function ($item) { |
|
52 | + return $slugs->map(function($item) { |
|
53 | 53 | return $item->slugable; |
54 | 54 | }); |
55 | 55 | } |
@@ -1,48 +1,48 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('slug_get_model')) { |
|
3 | +if (!function_exists('slug_get_model')) { |
|
4 | 4 | function slug_get_model($slug, $class = null) |
5 | 5 | { |
6 | 6 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModel($slug, $class); |
7 | 7 | } |
8 | 8 | } |
9 | 9 | |
10 | -if (! function_exists('slug_get_models')) { |
|
10 | +if (!function_exists('slug_get_models')) { |
|
11 | 11 | function slug_get_models($slugs, $class = null) |
12 | 12 | { |
13 | 13 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModels($slugs, $class); |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | -if (! function_exists('slug_get_id')) { |
|
17 | +if (!function_exists('slug_get_id')) { |
|
18 | 18 | function slug_get_id($slug, $class = null) |
19 | 19 | { |
20 | 20 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->getId($slug, $class); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (! function_exists('slug_get_ids')) { |
|
24 | +if (!function_exists('slug_get_ids')) { |
|
25 | 25 | function slug_get_ids($slugs, $class = null) |
26 | 26 | { |
27 | 27 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIds($slugs, $class); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -if (! function_exists('slug_get_grouped_class')) { |
|
31 | +if (!function_exists('slug_get_grouped_class')) { |
|
32 | 32 | function slug_get_grouped_class($attributes, $useId = false) |
33 | 33 | { |
34 | 34 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIdsGroupedByClass($attributes, $useId); |
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | -if (! function_exists('slug_make')) { |
|
38 | +if (!function_exists('slug_make')) { |
|
39 | 39 | function slug_make($model, $slug) |
40 | 40 | { |
41 | 41 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->makeForModel($model, $slug); |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | -if (! function_exists('slug_delete')) { |
|
45 | +if (!function_exists('slug_delete')) { |
|
46 | 46 | function slug_delete($model) |
47 | 47 | { |
48 | 48 | return app(\Fomvasss\SlugMaker\SlugHelper::class)->deleteByModel($model); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | public function scopeByClassesByNames($query, array $attributes, $key = 'name') |
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($key, $names); |
13 | 13 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $prefix = $this->slugConfig['prefix']; |
39 | 39 | $suffix = $this->slugConfig['suffix']; |
40 | 40 | |
41 | - $maximumLength= $this->slugConfig['maximum_length']; |
|
41 | + $maximumLength = $this->slugConfig['maximum_length']; |
|
42 | 42 | |
43 | 43 | if ($strLen = strlen($prefix) + strlen($suffix)) { |
44 | 44 | $limitWithoutPrefixSuffix = $maximumLength - ($strLen + 2); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | $slugs = is_array($slug) ? $slug : [$slug]; |
37 | 37 | |
38 | - return $query->whereHas('slug', function ($q) use ($slugs) { |
|
38 | + return $query->whereHas('slug', function($q) use ($slugs) { |
|
39 | 39 | $q->whereIn('name', $slugs); |
40 | 40 | }); |
41 | 41 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | __DIR__.'/../config/slugmaker.php' => $this->app->configPath().'/slugmaker.php', |
14 | 14 | ], 'slugmaker-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([ |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $this->mergeConfigFrom(__DIR__.'/../config/slugmaker.php', 'slugmaker-config'); |
28 | 28 | |
29 | - $this->app->bind(SlugHelper::class, function () { |
|
29 | + $this->app->bind(SlugHelper::class, function() { |
|
30 | 30 | return new SlugHelper(new Slug()); |
31 | 31 | }); |
32 | 32 | } |