Your IP : 216.73.216.93


Current Path : /home/users/unlimited/www/mpos.codeskitter.site/app/Models/
Upload File :
Current File : /home/users/unlimited/www/mpos.codeskitter.site/app/Models/Expense.php

<?php

namespace App\Models;

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

class Expense extends Model
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'expense_category_id',
        'business_id',
        'user_id',
        'amount',
        'expanseFor',
        'paymentType',
        'payment_type_id',
        'referenceNo',
        'note',
        'expenseDate',
    ];

    public function category() : BelongsTo
    {
        return $this->belongsTo(ExpenseCategory::class, 'expense_category_id');
    }

    public function payment_type() : BelongsTo
    {
        return $this->belongsTo(PaymentType::class);
    }

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'amount' => 'double',
        'user_id' => 'integer',
        'business_id' => 'integer',
        'payment_type_id' => 'integer',
        'expense_category_id' => 'integer',
    ];
}