-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTranslationModuleProvider.php
89 lines (71 loc) · 1.84 KB
/
TranslationModuleProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
namespace Anavel\Translation;
use Anavel\Foundation\Support\ModuleProvider;
use Request;
class TranslationModuleProvider extends ModuleProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
public function boot()
{
$this->loadViewsFrom(__DIR__.'/../views', 'anavel-translation');
$this->loadTranslationsFrom(__DIR__.'/../lang', 'anavel-translation');
// $this->publishes([
// __DIR__.'/../public/js' => public_path('vendor/anavel-translation/js'),
// ], 'assets');
$this->publishes([
__DIR__.'/../config/anavel-translation.php' => config_path('anavel-translation.php'),
], 'config');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/anavel-translation.php', 'anavel-translation');
$this->app->register('Anavel\Translation\Providers\ViewComposersServiceProvider');
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
public function name()
{
return config('anavel-translation.name');
}
public function routes()
{
return __DIR__.'/Http/routes.php';
}
public function mainRoute()
{
return route('anavel-translation.home');
}
public function hasSidebar()
{
return true;
}
public function sidebarMenu()
{
return 'anavel-translation::molecules.sidebar.default';
}
public function isActive()
{
$uri = Request::route()->uri();
if (strpos($uri, 'translation') !== false) {
return true;
}
return false;
}
}