Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class Grade extends Model |
||
9 | { |
||
10 | public $timestamps = true; |
||
11 | protected $table = 'grade'; |
||
12 | protected $fillable = [ |
||
13 | 'id', |
||
14 | 'name', |
||
15 | 'order' |
||
16 | ]; |
||
17 | |||
18 | public static function getAll() |
||
19 | { |
||
20 | 2 | return Cache::remember('grades', config('constants.GRADE_MINUTES'), function () { |
|
21 | 2 | return static::all(); |
|
22 | 2 | }); |
|
23 | } |
||
24 | |||
25 | public static function getAllPlucked() |
||
26 | { |
||
27 | 10 | return Cache::rememberForever('grades_pluck', function () { |
|
28 | 10 | return static::pluck('name', 'id'); |
|
29 | 10 | }); |
|
30 | |||
31 | } |
||
32 | |||
33 | 1 | public function getNameAttribute($name) |
|
36 | } |
||
37 | |||
38 | } |