-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructuredDataServiceProvider.php
87 lines (72 loc) · 2.29 KB
/
StructuredDataServiceProvider.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
<?php
namespace Ximdex\StructuredData;
use Illuminate\Support\ServiceProvider;
class StructuredDataServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'xlinkeddata');
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'xlinkeddata');
// Publishing is only necessary when using the CLI.
if ($this->app->runningInConsole()) {
$this->bootForConsole();
}
$this->commands([
\Ximdex\StructuredData\Commands\SchemasImporter::class
]);
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->loadRoutesFrom(__DIR__.'/../routes/api.php');
}
/**
* Register any package services.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__.'/../config/configs.php', 'structureddata');
// Register the service the package provides.
$this->app->singleton('structureddata', function ($app) {
return new StructuredData;
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['structureddata'];
}
/**
* Console-specific booting.
*
* @return void
*/
protected function bootForConsole()
{
// Publishing the configuration file.
$this->publishes([
__DIR__.'/../config/configs.php' => config_path('structureddata.php'),
], 'structureddata.config');
// Publishing the views.
/*$this->publishes([
__DIR__.'/../resources/views' => base_path('resources/views/vendor/xlinkeddata'),
], 'linkeddata.views');*/
// Publishing assets.
/*$this->publishes([
__DIR__.'/../resources/assets' => public_path('vendor/xlinkeddata'),
], 'linkeddata.views');*/
// Publishing the translation files.
/*$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/xlinkeddata'),
], 'linkeddata.views');*/
// Registering package commands.
}
}