-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathNlpServiceProvider.php
50 lines (40 loc) · 994 Bytes
/
NlpServiceProvider.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
<?php
namespace Web64\LaravelNlp;
use Illuminate\Support\ServiceProvider;
use Web64\LaravelNlp\LaravelNlp;
// php artisan vendor:publish --provider="Web64\LaravelNlp\NlpServiceProvider"
class NlpServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$app = $this->app ?: app();
$this->mergeConfigFrom(__DIR__.'/config/nlp.php', 'nlp');
$this->publishes([
__DIR__.'/config/nlp.php' => config_path('nlp.php'),
]);
$this->app->singleton(\Web64\LaravelNlp\LaravelNlp::class, function () use ($app) {
$config = $app['config']->get('nlp');
return new \Web64\LaravelNlp\LaravelNlp($config);
});
}
}