1 | <?php |
||
17 | class RouteServiceProvider extends ServiceProvider |
||
18 | { |
||
19 | /** |
||
20 | * This namespace is applied to the controller routes in your routes file. |
||
21 | * |
||
22 | * In addition, it is set as the URL generator's root namespace. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $namespace = 'Gitamin\Http\Controllers'; |
||
27 | |||
28 | /** |
||
29 | * Define the route model bindings, pattern filters, etc. |
||
30 | * |
||
31 | * @param \Illuminate\Routing\Router $router |
||
32 | */ |
||
33 | public function boot(Router $router) |
||
39 | |||
40 | /** |
||
41 | * Register model bindings. |
||
42 | */ |
||
43 | protected function registerBindings() |
||
44 | { |
||
45 | $this->app->router->model('owner', 'Gitamin\Models\Owner'); |
||
|
|||
46 | $this->app->router->model('project', 'Gitamin\Models\Project'); |
||
47 | $this->app->router->model('issue', 'Gitamin\Models\Issue'); |
||
48 | $this->app->router->model('comment', 'Gitamin\Models\Comment'); |
||
49 | $this->app->router->model('setting', 'Gitamin\Models\Setting'); |
||
50 | $this->app->router->model('subscriber', 'Gitamin\Models\Subscriber'); |
||
51 | $this->app->router->model('user', 'Gitamin\Models\User'); |
||
52 | $this->app->router->model('role', 'Gitamin\Models\Role'); |
||
53 | $this->app->router->model('permission', 'Gitamin\Models\Permission'); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Define the routes for the application. |
||
58 | * |
||
59 | * @param \Illuminate\Routing\Router $router |
||
60 | */ |
||
61 | public function map(Router $router) |
||
69 | } |
||
70 |
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: