ClientPaymentMethod.php 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. 'card_number',
  13. 'holder_name',
  14. 'expiration',
  15. 'cvv',
  16. 'card_name',
  17. 'brand',
  18. 'last_four_digits',
  19. 'is_active',
  20. ];
  21. protected $casts = [
  22. 'card_number' => 'encrypted',
  23. 'cvv' => 'encrypted',
  24. 'is_active' => 'boolean',
  25. 'created_at' => 'datetime',
  26. 'updated_at' => 'datetime',
  27. 'deleted_at' => 'datetime',
  28. ];
  29. protected $hidden = [
  30. // 'card_number',
  31. 'cvv',
  32. ];
  33. public function client(): BelongsTo
  34. {
  35. return $this->belongsTo(Client::class);
  36. }
  37. }