Formatting changes and updating class references from strings to use php ::class const

This commit is contained in:
Tom Lingham
2015-12-23 11:24:22 +00:00
parent 70d102f8bf
commit 28b0e04bb2
5 changed files with 33 additions and 16 deletions

View File

@ -26,9 +26,21 @@ class SearchyServiceProvider extends ServiceProvider
*/
public function registerSearchy()
{
$this->app->bindShared('searchy', function ($app) {
return new SearchBuilder($app['config']);
});
// Laravel <= 5.1
$closure = function ($app) {
return new SearchBuilder( $app['config'] );
};
if ( method_exists($this->app, 'bindShared') )
{
$this->app->bindShared('searchy', $closure);
}
// Laravel 5.2 Goodness :)
else {
$this->app->singleton('searchy', $closure);
}
}
/**