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

TutorialTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A templatePath() 0 3 1
A query() 0 6 1
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