-
Notifications
You must be signed in to change notification settings - Fork 0
Provider
Pedro Faria edited this page Apr 9, 2017
·
1 revision
You can extends or replace some funcionality of Hope using the Dependency Injection system. Just two steps and every thing is running.
- Create your own Provider.
<?php
namespace App\Providers;
class MyRequestProvider implements Hope\Contracts\ProviderInterface
{
public static function register(Hope\Application $app)
{
$app->bind('Hope\Http\Request', function() {
return new App\Http\MyRequest();
});
}
}
- Add it with the method
addExternalProviders
.
$app->addExternalProviders([
App\Providers\YourProviderClassProvider::class,
]);
CAUTION: This method must stay before bootstrap()
.