forked from area17/twill-capsule-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.php
32 lines (25 loc) · 802 Bytes
/
Model.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace App\Twill\Capsules\Base;
use A17\CDN\Behaviours\HasCDNTags;
use A17\Twill\Models\Model as TwillModel;
use A17\Twill\Models\Behaviors\HasMedias;
use A17\Twill\Models\Behaviors\HasRevisions;
use App\Twill\Capsules\Base\Scopes\MustBePublished;
use App\Twill\Capsules\Base\Scopes\MustHaveTranslation;
use Illuminate\Database\Eloquent\Factories\HasFactory;
abstract class Model extends TwillModel
{
use HasMedias, HasRevisions, HasFactory, HasCDNTags;
public $titleColumnKey = 'title';
public $translatedAttributes = [];
/**
* The "booted" method of the model.
*
* @return void
*/
protected static function booted()
{
static::addGlobalScope(new MustBePublished());
static::addGlobalScope(new MustHaveTranslation());
}
}