2020-12-21 07:09:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2020-12-27 00:34:07 +00:00
|
|
|
use App\Services\BookInformation\BookLookupService;
|
|
|
|
use App\Services\BookInformation\CachedService;
|
|
|
|
use App\Services\BookInformation\GoogleBooks;
|
2020-12-21 08:00:51 +00:00
|
|
|
use Illuminate\Pagination\Paginator;
|
2020-12-21 07:09:34 +00:00
|
|
|
use Schema;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider {
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot() {
|
|
|
|
Schema::defaultStringLength(191);
|
2020-12-21 08:00:51 +00:00
|
|
|
Paginator::useBootstrap();
|
2020-12-21 07:09:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register() {
|
2020-12-27 00:34:07 +00:00
|
|
|
$this->app->singleton(BookLookupService::class, function() {
|
|
|
|
return new CachedService(new GoogleBooks());
|
|
|
|
});
|
2020-12-21 07:09:34 +00:00
|
|
|
}
|
|
|
|
}
|