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 99use Illuminate \Support \Str ;
1010use Spatie \Translatable \HasTranslations ;
1111use Statikbe \FilamentFlexibleContentBlockPages \Facades \FilamentFlexibleContentBlockPages ;
12+ use Statikbe \FilamentFlexibleContentBlocks \Models \Concerns \HasCodeTrait ;
13+ use Statikbe \FilamentFlexibleContentBlocks \Models \Contracts \HasCode ;
1214
1315/**
1416 * @property string $code
1820 * @property bool $is_default_type
1921 * @property bool $has_seo_pages
2022 */
21- class TagType extends Model
23+ class TagType extends Model implements HasCode
2224{
2325 use HasTranslations;
26+ use HasCodeTrait;
2427
2528 public const TYPE_DEFAULT = 'default ' ;
2629
@@ -76,16 +79,6 @@ public function tags(): HasMany
7679 return $ this ->hasMany (FilamentFlexibleContentBlockPages::config ()->getTagModel ()::class, 'code ' , 'type ' );
7780 }
7881
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-
8982 public function formatColour (): ?string
9083 {
9184 if (! $ this ->colour ) {
You can’t perform that action at this time.
0 commit comments