PermissionsGroup::firstHashedOrFail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php namespace Arcanesoft\Auth\Models;
2
3
use \Arcanedev\LaravelAuth\Models\PermissionsGroup as BasePermissionsGroup;
4
5
/**
6
 * Class     PermissionsGroup
7
 *
8
 * @package  Arcanesoft\Auth\Models
9
 * @author   ARCANEDEV <[email protected]>
10
 *
11
 * @property  string  hashed_id
12
 */
13
class PermissionsGroup extends BasePermissionsGroup
14
{
15
    /* -----------------------------------------------------------------
16
     |  Traits
17
     | -----------------------------------------------------------------
18
     */
19
20
    use Presenters\PermissionsGroupPresenter;
21
22
    /* -----------------------------------------------------------------
23
     |  Main Methods
24
     | -----------------------------------------------------------------
25
     */
26
27
    /**
28
     * Get a permission from a hashed id or fail if not found.
29
     *
30
     * @param  string  $hashedId
31
     *
32
     * @return self
33
     *
34
     * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
35
     */
36
    public static function firstHashedOrFail($hashedId)
37
    {
38
        return self::withHashedId($hashedId)->firstOrFail();
39
    }
40
}
41