1 | <?php namespace Arcanesoft\Blog; |
||
12 | class Blog |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Properties |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Indicates if migrations will be run. |
||
21 | * |
||
22 | * @var bool |
||
23 | */ |
||
24 | public static $runsMigrations = true; |
||
25 | |||
26 | protected static $instance = null; |
||
27 | |||
28 | /* ----------------------------------------------------------------- |
||
29 | | Main Methods |
||
30 | | ----------------------------------------------------------------- |
||
31 | */ |
||
32 | |||
33 | /** |
||
34 | * Get the blog instance. |
||
35 | * |
||
36 | * @return Blog |
||
37 | */ |
||
38 | 6 | public static function instance() |
|
39 | { |
||
40 | 6 | if (is_null(static::$instance)) { |
|
41 | 3 | static::$instance = new static; |
|
42 | } |
||
43 | |||
44 | 6 | return static::$instance; |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * Publish the migrations. |
||
49 | */ |
||
50 | public static function publishMigrations() |
||
51 | { |
||
52 | static::$runsMigrations = false; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Register the public blog routes. |
||
57 | */ |
||
58 | public static function routes() |
||
59 | { |
||
60 | Route::name('public::blog.') |
||
61 | ->prefix('blog') |
||
62 | ->namespace('\\Arcanesoft\\Blog\\Http\\Controllers\\Front') |
||
63 | ->group(function () { |
||
64 | Routes\PostsRoutes::register(); |
||
65 | Routes\CategoriesRoutes::register(); |
||
66 | Routes\TagsRoutes::register(); |
||
67 | }); |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * Check if the blog is translatable. |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | 48 | public static function isTranslatable() |
|
79 | |||
80 | /** |
||
81 | * Check if the blog is seoable. |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | 3 | public static function isSeoable() |
|
90 | |||
91 | /** |
||
92 | * Get the supported locales. |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | public static function getSupportedLocalesKeys() |
||
104 | |||
105 | /** |
||
106 | * Check if the Media manager is installed. |
||
107 | * |
||
108 | * @return bool |
||
109 | */ |
||
110 | 3 | public static function isMediaManagerInstalled() |
|
114 | |||
115 | /** |
||
116 | * Check if the SEO manager is installed. |
||
117 | * |
||
118 | * @return bool |
||
119 | */ |
||
120 | 3 | public static function isSeoManagerInstalled() |
|
124 | |||
125 | /* ----------------------------------------------------------------- |
||
126 | | Other Methods |
||
127 | | ----------------------------------------------------------------- |
||
128 | */ |
||
129 | |||
130 | /** |
||
131 | * Check if the provider was registered in the container. |
||
132 | * |
||
133 | * @param string $provider |
||
134 | * |
||
135 | * @return bool |
||
136 | */ |
||
137 | 6 | protected static function hasRegisteredProvider($provider) |
|
141 | |||
142 | protected function __clone() |
||
146 | } |
||
147 |