|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace MeestorHok\Blue; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
|
6
|
|
|
use Form; |
|
7
|
|
|
|
|
8
|
|
|
class BlueServiceProvider extends ServiceProvider |
|
9
|
|
|
{ |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Perform post-registration booting of services. |
|
13
|
|
|
* |
|
14
|
|
|
* @return void |
|
15
|
|
|
*/ |
|
16
|
|
|
public function boot() |
|
17
|
|
|
{ |
|
18
|
|
|
$this->loadViewsFrom(__DIR__.'/resources/views', 'Blue'); |
|
19
|
|
|
|
|
20
|
|
|
$this->publishes([ |
|
21
|
|
|
__DIR__.'/resources/public' => public_path('blue'), |
|
22
|
|
|
], 'frontend'); |
|
23
|
|
|
|
|
24
|
|
|
$this->publishes([ |
|
25
|
|
|
__DIR__.'/Migrations' => database_path('migrations'), |
|
26
|
|
|
], 'migrations'); |
|
27
|
|
|
|
|
28
|
|
|
$this->publishes([ |
|
29
|
|
|
__DIR__.'/Http/routes.blue.php' => app_path('Http/routes.blue.php'), |
|
30
|
|
|
__DIR__.'/Http/routes.php' => app_path('Http/routes.php'), |
|
31
|
|
|
], 'routes'); |
|
32
|
|
|
|
|
33
|
|
|
Form::component('blueText', 'Blue::components.text', ['name', 'attributes' => []]); |
|
34
|
|
|
Form::component('blueEmail', 'Blue::components.email', ['name', 'attributes' => []]); |
|
35
|
|
|
Form::component('blueToggle', 'Blue::components.toggle', ['name', 'value' => null, 'checked' => false, 'attributes' => []]); |
|
36
|
|
|
Form::component('blueTextarea', 'Blue::components.textarea', ['name', 'attributes' => []]); |
|
37
|
|
|
Form::component('bluePassword', 'Blue::components.password', ['name', 'attributes' => []]); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Register any package services. |
|
42
|
|
|
* |
|
43
|
|
|
* @return void |
|
44
|
|
|
*/ |
|
45
|
|
|
public function register() |
|
46
|
|
|
{ |
|
47
|
|
|
$this->app->bind('SEO', function() { |
|
48
|
|
|
return new \MeestorHok\Blue\SEOGenerator; |
|
49
|
|
|
}); |
|
50
|
|
|
|
|
51
|
|
|
require app_path('Http/routes.blue.php'); |
|
52
|
|
|
require_once(__DIR__.'/helpers.php'); |
|
53
|
|
|
|
|
54
|
|
|
$this->app->register('Collective\Html\HtmlServiceProvider'); |
|
55
|
|
|
$this->app->register('Artesaos\SEOTools\Providers\SEOToolsServiceProvider'); |
|
56
|
|
|
|
|
57
|
|
|
$this->app->router->middleware('siteExists', \MeestorHok\Blue\Http\Middleware\SiteExistsMiddleware::class); |
|
|
|
|
|
|
58
|
|
|
$this->app->router->middleware('siteDoesntExist', \MeestorHok\Blue\Http\Middleware\SiteDoesntExistMiddleware::class); |
|
|
|
|
|
|
59
|
|
|
$this->app->router->middleware('adminExists', \MeestorHok\Blue\Http\Middleware\AdminExistsMiddleware::class); |
|
|
|
|
|
|
60
|
|
|
$this->app->router->middleware('adminDoesntExist', \MeestorHok\Blue\Http\Middleware\AdminDoesntExistMiddleware::class); |
|
|
|
|
|
|
61
|
|
|
|
|
62
|
|
|
$loader = \Illuminate\Foundation\AliasLoader::getInstance(); |
|
63
|
|
|
$loader->alias('Html', 'Collective\Html\HtmlFacade'); |
|
64
|
|
|
$loader->alias('Form', 'Collective\Html\FormFacade'); |
|
65
|
|
|
$loader->alias('SEO', 'MeestorHok\Blue\Facades\SEOFacade'); |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: