. */ namespace Poniverse\Ponyfm\Providers; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; use PfmValidator; use Poniverse; use Validator; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Validator::resolver(function($translator, $data, $rules, $messages) { return new PfmValidator($translator, $data, $rules, $messages); }); } /** * Register any application services. * * @return void */ public function register() { $this->app->bind(Poniverse::class, function(Application $app) { return new Poniverse($app['config']->get('poniverse.client_id'), $app['config']->get('poniverse.secret')); }); $this->app->bind(Poniverse\Ponyfm\Library\Search::class, function(Application $app) { return new Poniverse\Ponyfm\Library\Search( \Elasticsearch::connection(), $app['config']->get('ponyfm.elasticsearch_index') ); }); } }