Completed
Push — master ( d778e6...6d1c30 )
by ARCANEDEV
08:16
created

PermissionsGroup::hasher()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Auth\Models;
2
3
use \Arcanedev\LaravelAuth\Models\PermissionsGroup as BasePermissionsGroupModel;
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 BasePermissionsGroupModel
14
{
15
    /* ------------------------------------------------------------------------------------------------
16
     |  Traits
17
     | ------------------------------------------------------------------------------------------------
18
     */
19
    use Presenters\PermissionsGroupPresenter;
20
21
    /* ------------------------------------------------------------------------------------------------
22
     |  Main Function
23
     | ------------------------------------------------------------------------------------------------
24
     */
25
    /**
26
     * Get a permission from a hashed id or fail if not found.
27
     *
28
     * @param  string  $hashedId
29
     *
30
     * @return self
31
     *
32
     * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
33
     */
34
    public static function firstHashedOrFail($hashedId)
35
    {
36
        return self::withHashedId($hashedId)->firstOrFail();
37
    }
38
}
39