Completed
Push — master ( ca5c21...32bab7 )
by
unknown
05:48
created

TranslatableResource::creationFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace BBSLab\NovaTranslation\Resources;
4
5
use Laravel\Nova\Http\Requests\NovaRequest;
6
use Laravel\Nova\Resource;
7
8
abstract class TranslatableResource extends Resource
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public static function indexQuery(NovaRequest $request, $query)
14
    {
15
        return $query
16
            ->locale()
17
            ->with('translation');
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public static function scoutQuery(NovaRequest $request, $query)
24
    {
25
        return $query;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public static function detailQuery(NovaRequest $request, $query)
32
    {
33
        return parent::detailQuery($request, $query)->with('translation');
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public static function relatableQuery(NovaRequest $request, $query)
40
    {
41
        return parent::relatableQuery($request, $query);
42
    }
43
}
44