ClientPaymentMethod.php 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\SoftDeletes;
  6. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  7. class ClientPaymentMethod extends Model
  8. {
  9. use HasFactory, SoftDeletes;
  10. protected $fillable = [
  11. 'client_id',
  12. 'token',
  13. 'card_number',
  14. 'holder_name',
  15. 'expiration',
  16. 'cvv',
  17. 'card_name',
  18. 'brand',
  19. 'last_four_digits',
  20. 'is_active',
  21. ];
  22. protected $casts = [
  23. 'token' => 'encrypted',
  24. 'card_number' => 'encrypted',
  25. 'cvv' => 'encrypted',
  26. 'is_active' => 'boolean',
  27. 'created_at' => 'datetime',
  28. 'updated_at' => 'datetime',
  29. 'deleted_at' => 'datetime',
  30. ];
  31. protected $hidden = [
  32. 'token',
  33. 'card_number',
  34. 'cvv',
  35. ];
  36. public function client(): BelongsTo
  37. {
  38. return $this->belongsTo(Client::class);
  39. }
  40. }