-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPackageServiceProvider.php
More file actions
57 lines (46 loc) · 1.96 KB
/
PackageServiceProvider.php
File metadata and controls
57 lines (46 loc) · 1.96 KB
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
<?php
namespace ProcessMaker\Package\PackageSkeleton;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use ProcessMaker\Package\Packages\Events\PackageEvent;
use ProcessMaker\Package\PackageSkeleton\Http\Middleware\AddToMenus;
use ProcessMaker\Package\PackageSkeleton\Listeners\PackageListener;
class PackageServiceProvider extends ServiceProvider
{
/**
* If your plugin will provide any services, you can register them here.
* See: https://laravel.com/docs/5.6/providers#the-register-method
*/
public function register()
{
// Nothing is registered at this time
}
/**
* After all service provider's register methods have been called, your boot method
* will be called. You can perform any initialization code that is dependent on
* other service providers at this time. We've included some example behavior
* to get you started.
*
* See: https://laravel.com/docs/5.6/providers#the-boot-method
*/
public function boot()
{
if ($this->app->runningInConsole()) {
require(__DIR__ . '/../routes/console.php');
} else {
// Assigning to the web middleware will ensure all other middleware assigned to 'web'
// will execute. If you wish to extend the user interface, you'll use the web middleware
Route::middleware('web')
->group(__DIR__ . '/../routes/web.php');
Route::middleware('api')
->prefix('api/1.0')
->group(__DIR__ . '/../routes/api.php');
Route::pushMiddlewareToGroup('web', AddToMenus::class);
}
$this->loadViewsFrom(__DIR__ . '/../resources/views/', 'package-skeleton');
$this->publishes([
__DIR__.'/../public' => public_path('vendor/processmaker/packages/package-skeleton'),
], 'package-skeleton');
$this->app['events']->listen(PackageEvent::class, PackageListener::class);
}
}