akaunting/app/Models/Module/Module.php
2021-09-07 10:33:34 +03:00

39 lines
751 B
PHP

<?php
namespace App\Models\Module;
use App\Abstracts\Model;
class Module extends Model
{
protected $table = 'modules';
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['company_id', 'alias', 'enabled', 'created_from', 'created_by'];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'enabled' => 'boolean',
];
/**
* 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);
}
}