1
|
|
|
<?php namespace Arcanesoft\Blog; |
2
|
|
|
|
3
|
|
|
use Arcanesoft\Blog\Http\Routes\Front as Routes; |
4
|
|
|
use Illuminate\Support\Facades\Route; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Class Blog |
8
|
|
|
* |
9
|
|
|
* @package Arcanesoft\Blog |
10
|
|
|
* @author ARCANEDEV <[email protected]> |
11
|
|
|
*/ |
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
|
|
|
/* ----------------------------------------------------------------- |
27
|
|
|
| Main Methods |
28
|
|
|
| ----------------------------------------------------------------- |
29
|
|
|
*/ |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Publish the migrations. |
33
|
|
|
*/ |
34
|
|
|
public static function publishMigrations() |
35
|
|
|
{ |
36
|
|
|
static::$runsMigrations = false; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Register the public blog routes. |
41
|
|
|
*/ |
42
|
|
|
public static function routes() |
43
|
|
|
{ |
44
|
|
|
Route::name('public::blog.') |
45
|
|
|
->prefix('blog') |
46
|
|
|
->namespace('\\Arcanesoft\\Blog\\Http\\Controllers\\Front') |
47
|
|
|
->group(function () { |
48
|
|
|
Routes\PostsRoutes::register(); |
49
|
|
|
Routes\CategoriesRoutes::register(); |
50
|
|
|
Routes\TagsRoutes::register(); |
51
|
|
|
}); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Check if the blog is translatable. |
56
|
|
|
* |
57
|
|
|
* @return bool |
58
|
|
|
*/ |
59
|
|
|
public function isTranslatable() |
60
|
|
|
{ |
61
|
|
|
return config('arcanesoft.blog.translatable.enabled', false); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Get the supported locales. |
66
|
|
|
* |
67
|
|
|
* @return array |
68
|
|
|
*/ |
69
|
|
|
public function getSupportedLocalesKeys() |
70
|
|
|
{ |
71
|
|
|
return array_unique(config('localization.supported-locales', [])); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Check if the media manager is installed. |
76
|
|
|
* |
77
|
|
|
* @return bool |
78
|
|
|
*/ |
79
|
3 |
|
public function isMediaManagerInstalled() |
80
|
|
|
{ |
81
|
3 |
|
return array_key_exists('Arcanesoft\Media\MediaServiceProvider', app()->getLoadedProviders()); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|