Withdraw.php 622 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  4. class Withdraw extends BaseModel
  5. {
  6. protected $table = 'withdraws';
  7. protected $fillable = [
  8. 'member_id',
  9. 'amount',
  10. 'service_charge',
  11. 'to_account',
  12. 'address',
  13. 'exchange_rate',
  14. 'status',
  15. 'after_balance',
  16. 'remark',
  17. 'admin_note',
  18. ];
  19. protected $hidden = [];
  20. public function member(): BelongsTo
  21. {
  22. return $this->belongsTo(User::class, 'member_id', 'member_id')
  23. ->select(['member_id', 'username', 'first_name']);
  24. }
  25. }