Total Complexity | 4 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | class UserNotification extends AbstractModel |
||
12 | { |
||
13 | /** |
||
14 | * The "booting" method of the model. |
||
15 | * |
||
16 | * @return void |
||
17 | */ |
||
18 | protected static function boot() |
||
19 | { |
||
20 | parent::boot(); |
||
21 | |||
22 | // Query scopes |
||
23 | static::addGlobalScope(new CreatedOrderScope()); |
||
24 | } |
||
25 | |||
26 | protected $connection = 'mysql'; |
||
27 | protected $table = 'user_notification'; |
||
28 | protected $primaryKey = 'user_notification_id'; |
||
29 | |||
30 | protected $fillable = [ |
||
31 | 'user_notification_id', |
||
32 | 'user_id', |
||
33 | 'type', |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * Query Builder. |
||
38 | * |
||
39 | * @param $query |
||
40 | * |
||
41 | * @return UserNotificationBuilder |
||
42 | */ |
||
43 | public function newEloquentBuilder($query) |
||
44 | { |
||
45 | return new UserNotificationBuilder($query); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Custom query Builder. |
||
50 | * |
||
51 | * @return UserNotificationBuilder|Builder |
||
52 | */ |
||
53 | public static function query(): UserNotificationBuilder |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * User model this notification subscription belongs to. |
||
60 | * |
||
61 | * @return BelongsTo |
||
62 | */ |
||
63 | public function user() |
||
66 | } |
||
67 | } |
||
68 |