| Current Path : /home/users/unlimited/www/medico.codeskitter.site/app/Models/ |
| Current File : /home/users/unlimited/www/medico.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',
'referenceNo',
'note',
'expenseDate',
];
public function category() : BelongsTo
{
return $this->belongsTo(ExpenseCategory::class, 'expense_category_id');
}
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'amount' => 'double',
'user_id' => 'integer',
'business_id' => 'integer',
'expense_category_id' => 'integer',
];
}