/
FollowerServiceProvider.php
92 lines (73 loc) · 2.1 KB
/
FollowerServiceProvider.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
90
91
92
<?php
namespace Foostart\Follower;
use Illuminate\Support\ServiceProvider;
use LaravelAcl\Authentication\Classes\Menu\SentryMenuFactory;
use URL,
Route;
use Illuminate\Http\Request;
class FollowerServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot(Request $request) {
//generate context key
// $this->generateContextKey();
// load view
$this->loadViewsFrom(__DIR__ . '/Views', 'package-follower');
// include view composers
require __DIR__ . "/composers.php";
// publish config
$this->publishConfig();
// publish lang
$this->publishLang();
// publish views
$this->publishViews();
// publish assets
$this->publishAssets();
}
/**
* Register the application services.
*
* @return void
*/
public function register() {
include __DIR__ . '/routes.php';
}
/**
* Public config to system
* @source: vendor/foostart/package-follower/config
* @destination: config/
*/
protected function publishConfig() {
$this->publishes([
__DIR__ . '/config/package-follower.php' => config_path('package-follower.php'),
], 'config');
}
/**
* Public language to system
* @source: vendor/foostart/package-follower/lang
* @destination: resources/lang
*/
protected function publishLang() {
$this->publishes([
__DIR__ . '/lang' => base_path('resources/lang'),
]);
}
/**
* Public view to system
* @source: vendor/foostart/package-follower/Views
* @destination: resources/views/vendor/package-follower
*/
protected function publishViews() {
$this->publishes([
__DIR__ . '/Views' => base_path('resources/views/vendor/package-follower'),
]);
}
protected function publishAssets() {
$this->publishes([
__DIR__ . '/public' => public_path('packages/foostart/package-follower'),
]);
}
}