Passed
Push — master ( 51edae...d29a9b )
by Curtis
11:52 queued 05:54
created

RoleTable::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\Roles;
4
5
use Illuminate\Database\Eloquent\Builder;
6
use App\Models\enso\Roles\Role;
7
use LaravelEnso\Tables\Contracts\Table;
8
9
class RoleTable implements Table
10
{
11
    protected const TemplatPath = __DIR__.'/../../../Templates/enso/roles/roles.json';
12
13
    public function query(): Builder
14
    {
15
        return Role::selectRaw('
0 ignored issues
show
Bug Best Practice introduced by
The expression return App\Models\enso\R...u_id', '=', 'menus.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
            roles.id, roles.name, roles.display_name, roles.description,
17
            roles.created_at, menus.name as defaultMenu
18
        ')->leftJoin('menus', 'roles.menu_id', '=', 'menus.id');
19
    }
20
21
    public function templatePath(): string
22
    {
23
        return static::TemplatPath;
24
    }
25
}
26