How to get access to container
?
I have a very simple search & replace method that needs settings.
/**
* @var SettingsRepositoryInterface
*/
protected $settings;
public function __construct(SettingsRepositoryInterface $settings)
{
$this->settings = $settings;
}
How do I need to register thuis to be used in extend.php
?
I thought I could just use $this->app->make..
but that's not available on extend.php anymore.
(new Extend\ApiSerializer(BasicPostSerializer::class))
->attributes(function($serializer, $model, $attributes) {
$existing_content = $attributes['contentHtml'];
$attributes['contentHtml']=$this->container->make(PostAffiliatorSerializer::class)->affiliate($existing_content);
return $attributes;
})