1 | <?php |
||
2 | |||
3 | namespace IlyasKazi\Instamojo\Models; |
||
4 | |||
5 | use Illuminate\Database\Eloquent\Model; |
||
6 | use Illuminate\Database\Eloquent\SoftDeletes; |
||
7 | |||
8 | class InstamojoRefund extends Model |
||
9 | { |
||
10 | use SoftDeletes; |
||
11 | |||
12 | /** |
||
13 | * The table associated with the model. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $table = 'instamojo_refund'; |
||
18 | |||
19 | /** |
||
20 | * The attributes that are mass assignable. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $fillable = ['user_id','refund_id','payment_id','status','type','body','refund_amount','total_amount','created_by']; |
||
25 | |||
26 | /** |
||
27 | * The "booting" method of the model. |
||
28 | * |
||
29 | * @return void |
||
30 | */ |
||
31 | public static function boot() |
||
32 | { |
||
33 | parent::boot(); |
||
34 | |||
35 | static::creating(function($model) { |
||
36 | $model->created_by = \Auth::user()->id; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
37 | }); |
||
38 | |||
39 | static::updating(function($model) { |
||
40 | $model->updated_by = \Auth::user()->id; |
||
0 ignored issues
–
show
|
|||
41 | }); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * [user description] |
||
46 | * @return [type] [description] |
||
0 ignored issues
–
show
|
|||
47 | */ |
||
48 | public function user() |
||
49 | { |
||
50 | return $this->hasOne('App\User', 'id', 'user_id'); |
||
51 | } |
||
52 | } |
||
53 |