<?php

namespace App\Models;

use App\Models\Client\Client;
use App\Trait\HasSlug;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Tranche extends Model {
    use HasFactory, SoftDeletes, HasSlug;

    protected $fillable = [
        'funder_name',
        'tranche_name',
        'amount_per_case',
        'description',
        'funded_date'
    ];

    public $casts = [
        'funded_date' => 'datetime',
    ];

    public function clients() {
        return $this->hasMany(Client::class);
    }
}
