Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
ShortcutVersion | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
boot | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
shortcutVersions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
shortcut | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Http\Models; |
4 | |
5 | use App\Http\Scopes\UserScope; |
6 | use MongoDB\Laravel\Eloquent\SoftDeletes; |
7 | |
8 | class ShortcutVersion extends Moloquent |
9 | { |
10 | use SoftDeletes; |
11 | |
12 | protected $table = 'shortcut_versions'; |
13 | |
14 | protected $cast = [ |
15 | 'created_at' => 'datetime', |
16 | 'updated_at' => 'datetime', |
17 | ]; |
18 | |
19 | protected $dates = ['deleted_at']; |
20 | |
21 | protected $guarded = []; |
22 | |
23 | protected static function boot() |
24 | { |
25 | parent::boot(); |
26 | static::addGlobalScope(new UserScope); |
27 | } |
28 | |
29 | public function shortcutVersions() |
30 | { |
31 | return $this->hasOne(ShortcutVersion::class, 'shortcut_id'); |
32 | } |
33 | |
34 | public function shortcut() |
35 | { |
36 | return $this->belongsTo(Shortcut::class); |
37 | } |
38 | } |