<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Invoice extends Model
{
    protected $connection = 'mysql';

    protected $fillable = [
        'tenant_id',
        'amount',
        'status',
        'due_date',
        'description',
    ];

    protected $casts = [
        'due_date' => 'date',
    ];

    public function tenant()
    {
        return $this->belongsTo(Tenant::class, 'tenant_id', 'id');
    }
}
