/** * Bootstrap the application services. */ public function boot() { parent::boot(); $this->publishMigrations(); $app = $this->app; if ($app->bound('form')) { $app->form->macro('selectCountry', function ($name, $selected = null, $options = []) use($app) { $countries = Cache::rememberForever('brianfaust.countries.select.name.cca2', function () { $records = Country::get(['name', 'cca2']); $countries = new Collection(); $records->map(function ($item) use(&$countries) { $countries[$item['cca2']] = $item['name']['official']; }); return $countries->sort(); }); return $app->form->select($name, $countries, $selected, $options); }); $app->form->macro('selectCountryWithId', function ($name, $selected = null, $options = []) use($app) { $countries = Cache::rememberForever('brianfaust.countries.select.id.cca2', function () { $records = Country::get(['name', 'id']); $countries = new Collection(); $records->map(function ($item) use(&$countries) { $countries[$item['id']] = $item['name']['official']; }); return $countries->sort(); }); return $app->form->select($name, $countries, $selected, $options); }); } }
/** * Bootstrap the application services. */ public function boot() { parent::boot(); $this->publishConfig(); $this->publishViews(); $this->loadViews(); }
/** * Bootstrap the application services. */ public function boot() { parent::boot(); $this->publishMigrations(); $this->publishConfig(); new Macros($this->app); }
/** * Bootstrap the application services. */ public function boot() { parent::boot(); $this->publishMigrations(); $this->publishConfig(); }