akaunting/app/Models/Module/Module.php

39 lines
751 B
PHP
Raw Normal View History

2017-09-14 19:21:00 +00:00
<?php
namespace App\Models\Module;
2019-11-16 07:21:14 +00:00
use App\Abstracts\Model;
2017-09-14 19:21:00 +00:00
class Module extends Model
{
protected $table = 'modules';
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
2021-09-07 07:33:34 +00:00
protected $fillable = ['company_id', 'alias', 'enabled', 'created_from', 'created_by'];
2017-12-27 14:06:14 +00:00
2020-11-13 12:15:27 +00:00
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'enabled' => 'boolean',
];
2017-12-27 14:06:14 +00:00
/**
* Scope alias.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $alias
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeAlias($query, $alias)
{
return $query->where('alias', $alias);
}
2017-09-14 19:21:00 +00:00
}