However the register() or boot() methods in my service provider are never called no matter if I register it in composer.json or config/app.php.
I’ve been just initializing all services using an ‘init’ action and creating them using app()->make(MyService::class) but that feels rather wrong and incomplete if there is a proper way using a service provider.
Hello @tombro , thanks, I am aware of that but as mentioned I still wasn’t able to have the register() or boot() methods of my service provider to being called. Any idea?
@flei
Something similar happened to me, it drove me crazy, because none of the clear ones responded to me (wp acorn optimize:clear, etc) so I manually deleted all the content of the cache folder located in wp-content/cache (in bedrock web /app/cache ) and it worked. Due to lack of time I was not able to review much why Acorn’s clear cache was not working but it worked.
This great but I think registering my services in the ThemeServiceProvider, keeps my code clean and helps me avoid cluttering functions.php which is among the a million reasons I choose to develop in sage.
sage10 make this very straight forward once you have a service provider just register it in the register method like this:
/**
* Register any application services.
*
* @return void
*/
public function register()
{
parent::register();
$this->app->register(TransactionsServiceProvider::class);
}
Thank you so much for this quick reply.
The yarn install and yarn dev/build are working properly fine.
Wordpress installed with Ubuntu works great as well with a standard theme.
When I activated Sage, I can still access the wp-admin of my localhost but I can’t reach my page because of Sage.view error.
I saw your previous post on how to register all the service providers. Thank you for sharing that. Not sure what service providers to put in my ThemeServiceProvider.php file tho? Can you tell me?
mhhm… I would have loved if you provided a screenshot or a little detailed information of what you trying to achieve and the what is the stumbling block, i.e does the issue have to do with component, composers etc, just alittle of background.