Issues (35)

src/helpers.php (7 issues)

1
<?php
2
3
if (! function_exists('slug_get_model')) {
4
    function slug_get_model($slug, $class = null)
5
    {
6
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModel($slug, $class);
7
    }
8
}
9
10
if (! function_exists('slug_get_models')) {
11
    function slug_get_models($slugs, $class = null)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
12
    {
13
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getModels($slugs, $class);
14
    }
15
}
16
17
if (! function_exists('slug_get_id')) {
18
    function slug_get_id($slug, $class = null)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
19
    {
20
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getId($slug, $class);
21
    }
22
}
23
24
if (! function_exists('slug_get_ids')) {
25
    function slug_get_ids($slugs, $class = null)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
    {
27
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIds($slugs, $class);
28
    }
29
}
30
31
if (! function_exists('slug_get_grouped_class')) {
32
    function slug_get_grouped_class($attributes, $useId = false)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
33
    {
34
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getIdsGroupedByClass($attributes, $useId);
35
    }
36
}
37
38
if (! function_exists('slug_get')) {
39
    function slug_get($model)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
40
    {
41
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->getSlugName($model);
42
    }
43
}
44
45
if (! function_exists('slug_make')) {
46
    function slug_make($model, $slug = '')
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
47
    {
48
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->makeForModel($model, $slug);
49
    }
50
}
51
52
if (! function_exists('slug_delete')) {
53
    function slug_delete($model)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
54
    {
55
        return app(\Fomvasss\SlugMaker\SlugHelper::class)->deleteByModel($model);
56
    }
57
}
58