6
6
use Statikbe \FilamentFlexibleContentBlockPages \Models \Page ;
7
7
use Statikbe \FilamentFlexibleContentBlockPages \Models \Redirect ;
8
8
use Statikbe \FilamentFlexibleContentBlockPages \Models \Settings ;
9
+ use Statikbe \FilamentFlexibleContentBlockPages \Models \Tag ;
10
+ use Statikbe \FilamentFlexibleContentBlockPages \Models \TagType ;
9
11
use Statikbe \FilamentFlexibleContentBlockPages \Routes \Contracts \HandlesPageRoutes ;
10
12
use Statikbe \FilamentFlexibleContentBlockPages \Routes \LocalisedPageRouteHelper ;
11
13
use Statikbe \FilamentFlexibleContentBlocks \FilamentFlexibleContentBlocksServiceProvider ;
@@ -20,19 +22,32 @@ class FilamentFlexibleContentBlockPagesConfig
20
22
21
23
const TYPE_AUTHOR = 'authors ' ;
22
24
25
+ const TYPE_TAG = 'tags ' ;
26
+
27
+ const TYPE_TAG_TYPE = 'tag_types ' ;
28
+
29
+ const TYPE_TAGGABLE = 'taggables ' ;
30
+
23
31
private string $ pageModel ;
24
32
25
33
private string $ redirectModel ;
26
34
27
35
private string $ settingsModel ;
28
36
37
+ private string $ tagModel ;
38
+
39
+ private string $ tagTypeModel ;
40
+
29
41
private HandlesPageRoutes $ routeHelper ;
30
42
31
43
public function __construct ()
32
44
{
33
- $ this ->pageModel = $ this ->packageConfig ('models.page ' , Page::class);
34
- $ this ->redirectModel = $ this ->packageConfig ('models.redirect ' , Redirect::class);
35
- $ this ->settingsModel = $ this ->packageConfig ('models.settings ' , Settings::class);
45
+ $ this ->pageModel = $ this ->packageConfig ('models. ' .static ::TYPE_PAGE , Page::class);
46
+ $ this ->redirectModel = $ this ->packageConfig ('models. ' .static ::TYPE_REDIRECT , Redirect::class);
47
+ $ this ->settingsModel = $ this ->packageConfig ('models. ' .static ::TYPE_SETTINGS , Settings::class);
48
+ $ this ->tagModel = $ this ->packageConfig ('models. ' .static ::TYPE_TAG , Tag::class);
49
+ $ this ->tagTypeModel = $ this ->packageConfig ('models. ' .static ::TYPE_TAG_TYPE , TagType::class);
50
+
36
51
}
37
52
38
53
public function getSupportedLocales (): array
@@ -58,24 +73,49 @@ public function getSettingsModel(): Settings
58
73
return app ($ this ->settingsModel );
59
74
}
60
75
76
+ public function getTagModel (): Tag
77
+ {
78
+ return app ($ this ->tagModel );
79
+ }
80
+
81
+ public function getTagTypeModel (): TagType
82
+ {
83
+ return app ($ this ->tagTypeModel );
84
+ }
85
+
61
86
public function getAuthorsTable (): string
62
87
{
63
- return $ this ->packageConfig ('table_names.authors ' , 'users ' );
88
+ return $ this ->packageConfig ('table_names. ' . static :: TYPE_AUTHOR , 'users ' );
64
89
}
65
90
66
91
public function getPagesTable (): string
67
92
{
68
- return $ this ->packageConfig ('table_names.pages ' , 'pages ' );
93
+ return $ this ->packageConfig ('table_names. ' . static :: TYPE_PAGE , 'pages ' );
69
94
}
70
95
71
96
public function getRedirectsTable (): string
72
97
{
73
- return $ this ->packageConfig ('table_names.redirects ' , 'redirects ' );
98
+ return $ this ->packageConfig ('table_names. ' . static :: TYPE_REDIRECT , 'redirects ' );
74
99
}
75
100
76
101
public function getSettingsTable (): string
77
102
{
78
- return $ this ->packageConfig ('table_names.settings ' , 'settings ' );
103
+ return $ this ->packageConfig ('table_names. ' .static ::TYPE_SETTINGS , 'settings ' );
104
+ }
105
+
106
+ public function getTagsTable (): string
107
+ {
108
+ return $ this ->packageConfig ('table_names. ' .static ::TYPE_TAG , 'tags ' );
109
+ }
110
+
111
+ public function getTagTypesTable (): string
112
+ {
113
+ return $ this ->packageConfig ('table_names. ' .static ::TYPE_TAG_TYPE , 'tag_types ' );
114
+ }
115
+
116
+ public function getTaggablesTable (): string
117
+ {
118
+ return $ this ->packageConfig ('table_names. ' .static ::TYPE_TAGGABLE , 'taggables ' );
79
119
}
80
120
81
121
/**
0 commit comments