Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Laravel\Tinker;
4
 
5
use Illuminate\Contracts\Support\DeferrableProvider;
6
use Illuminate\Foundation\Application as LaravelApplication;
7
use Illuminate\Support\ServiceProvider;
8
use Laravel\Lumen\Application as LumenApplication;
9
use Laravel\Tinker\Console\TinkerCommand;
10
 
11
class TinkerServiceProvider extends ServiceProvider implements DeferrableProvider
12
{
13
    /**
14
     * Boot the service provider.
15
     *
16
     * @return void
17
     */
18
    public function boot()
19
    {
20
        $source = realpath($raw = __DIR__.'/../config/tinker.php') ?: $raw;
21
 
22
        if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
23
            $this->publishes([$source => config_path('tinker.php')]);
24
        } elseif ($this->app instanceof LumenApplication) {
25
            $this->app->configure('tinker');
26
        }
27
 
28
        $this->mergeConfigFrom($source, 'tinker');
29
    }
30
 
31
    /**
32
     * Register the service provider.
33
     *
34
     * @return void
35
     */
36
    public function register()
37
    {
38
        $this->app->singleton('command.tinker', function () {
39
            return new TinkerCommand;
40
        });
41
 
42
        $this->commands(['command.tinker']);
43
    }
44
 
45
    /**
46
     * Get the services provided by the provider.
47
     *
48
     * @return array
49
     */
50
    public function provides()
51
    {
52
        return ['command.tinker'];
53
    }
54
}