'add from payment', 2 => 'deduction from payment', ]; protected $table = 'user_pay_credits'; protected $casts = [ 'user_id' => 'int', 'credit' => 'float', 'old_credit_total' => 'float', 'new_credit_total' => 'float', 'status' => 'int', 'shopping_order_id' => 'int' ]; protected $fillable = [ 'user_id', 'credit', 'old_credit_total', 'new_credit_total', 'message', 'status', 'shopping_order_id' ]; public function shopping_order() { return $this->belongsTo(ShoppingOrder::class); } public function user() { return $this->belongsTo(User::class); } }