*/ protected $fillable = [ 'unique_id', 'card_type_id', 'card_number', 'region', 'branch_id', 'customer_name', 'customer_surname', 'customer_patronic_name', 'born_at', 'phone', 'passport_serie', 'passport_id', 'status', 'passport_one', 'passport_two', 'passport_three', 'passport_four', 'notes', 'user_id', 'ready_files', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'born_at' => 'date', ]; /** * User */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Card type */ public function cardType(): BelongsTo { return $this->belongsTo(CardType::class, 'card_type_id'); } /** * Branch */ public function branch(): BelongsTo { return $this->belongsTo(Branch::class, 'branch_id'); } }