1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-15 11:00:48 +01:00
openstamanager/include/src/Description.php
2018-10-05 11:22:32 +02:00

31 lines
587 B
PHP

<?php
namespace Common;
use Illuminate\Database\Eloquent\Builder;
abstract class Description extends Model
{
protected static function boot($bypass = false)
{
parent::boot();
if (!$bypass) {
static::addGlobalScope('descriptions', function (Builder $builder) {
$builder->where('is_descrizione', '=', 0);
});
}
}
public static function make($bypass = false)
{
$model = parent::make();
if (!$bypass) {
$model->is_descrizione = 1;
}
return $model;
}
}