Passed
Push — master ( b8999c...a2f941 )
by Curtis
09:12 queued 03:15
created

TutorialTable::templatePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Tables\Builders\enso\Tutorials;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use LaravelEnso\Tables\Contracts\Table;
7
use App\Models\enso\Tutorials\Tutorial;
8
9
class TutorialTable implements Table
10
{
11
    protected const TemplatePath = __DIR__.'/../../../Templates/enso/tutorials/tutorials.json';
12
13
    public function query(): Builder
14
    {
15
        return Tutorial::selectRaw('
0 ignored issues
show
Bug Best Practice introduced by
The expression return App\Models\enso\T...torials.permission_id') could return the type Illuminate\Database\Query\Builder which is incompatible with the type-hinted return Illuminate\Database\Eloquent\Builder. Consider adding an additional type-check to rule them out.
Loading history...
16
            tutorials.id, permissions.name as permission, tutorials.element,
17
            tutorials.title, tutorials.placement, tutorials.order_index, tutorials.created_at
18
        ')->join('permissions', 'permissions.id', '=', 'tutorials.permission_id');
19
    }
20
21
    public function templatePath(): string
22
    {
23
        return static::TemplatePath;
24
    }
25
}
26