Your IP : 216.73.216.91


Current Path : /var/www/html/LLCF-APP/app/Models/
Upload File :
Current File : /var/www/html/LLCF-APP/app/Models/Expense.php

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Expense extends Model
{
    use HasFactory;

    /**
     * The table associated with the model.
     */
    protected $table = 'expenses';

    /**
     * The attributes that are mass assignable.
     */
    protected $fillable = [
        'item_id',
        'date',
        'type',
        'amount',
    ];

    /**
     * The attributes that should be cast.
     */
    protected $casts = [
        'date' => 'date:Y-m-d',
    ];

    /**
     * Get the item associated with this expense.
     */
    public function item()
    {
        return $this->belongsTo(Item::class, 'item_id');
    }
}