Passed
Push — master ( 4a474d...df1b75 )
by Stephen
02:14
created

UserRolesQuery::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Sfneal\Users\Queries;
4
5
use Sfneal\Users\Models\Role;
6
use Illuminate\Database\Eloquent\Collection;
7
use Sfneal\Caching\Traits\Cacheable;
8
use Sfneal\Queries\AbstractQuery;
9
10
class UserRolesQuery extends AbstractQuery
11
{
12
    use Cacheable;
13
14
    /**
15
     * Execute the Query.
16
     *
17
     * @return Collection
18
     */
19
    public function execute()
20
    {
21
        return Role::query()->whereTypeUser()->get();
22
    }
23
24
    /**
25
     * Retrieve the Query cache key.
26
     *
27
     * @return string
28
     */
29
    public function cacheKey(): string
30
    {
31
        return Role::getTableName().':types#user';
32
    }
33
}
34