1 | <?php |
||
7 | class UserRuby extends Model |
||
8 | { |
||
9 | use UserRubyPresenter; |
||
10 | |||
11 | /** |
||
12 | * The attributes that are mass assignable. |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $fillable = [ |
||
17 | 'user_id', |
||
18 | 'obtainable_id', |
||
19 | 'obtainable_type' |
||
20 | ]; |
||
21 | |||
22 | /** |
||
23 | * The "booting" method of the model. |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | protected static function boot() |
||
36 | |||
37 | /** |
||
38 | * Get the user that owns the log. |
||
39 | * |
||
40 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
41 | */ |
||
42 | public function user() |
||
46 | |||
47 | /** |
||
48 | * Get the obtainable relation. |
||
49 | * |
||
50 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
51 | */ |
||
52 | public function obtainable() |
||
56 | } |
||
57 |