File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 9
9
use Illuminate \Support \Str ;
10
10
use Spatie \Translatable \HasTranslations ;
11
11
use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
12
+ use Statikbe \FilamentFlexibleContentBlocks \Models \Concerns \HasCodeTrait ;
13
+ use Statikbe \FilamentFlexibleContentBlocks \Models \Contracts \HasCode ;
12
14
13
15
/**
14
16
* @property string $code
18
20
* @property bool $is_default_type
19
21
* @property bool $has_seo_pages
20
22
*/
21
- class TagType extends Model
23
+ class TagType extends Model implements HasCode
22
24
{
23
25
use HasTranslations;
26
+ use HasCodeTrait;
24
27
25
28
public const TYPE_DEFAULT = 'default ' ;
26
29
@@ -76,16 +79,6 @@ public function tags(): HasMany
76
79
return $ this ->hasMany (FilamentFlexibleContentBlockPages::config ()->getTagModel ()::class, 'code ' , 'type ' );
77
80
}
78
81
79
- public function scopeCode (Builder $ query , string $ code ): void
80
- {
81
- $ query ->where ('code ' , $ code );
82
- }
83
-
84
- public static function getByCode (string $ code ): ?self
85
- {
86
- return static ::code ($ code )->first ();
87
- }
88
-
89
82
public function formatColour (): ?string
90
83
{
91
84
if (! $ this ->colour ) {
You can’t perform that action at this time.
0 commit comments