Support the ongoing development of Laravel.io →
posted 10 years ago
IOC
Last updated 2 years ago.
0

The parent's constructor is not automatically fired when extending it. So the repo is not setup when you do

new Provider1DeliveryReport();

You can solve it by adding parent::__construct() to you Provider1DeliveryReport::__construct() but that's the same amount of work as injecting the repo.

Maybe somebody else has a great idea.

Last updated 2 years ago.
0

Thanks for your reply zenry.

Actually, the only way I get this working is to do like this on all provider classes:

public function __construct(DeliveryReportRepositoryInterface $repo)
{
	parent::__construct($repo);
}

Hopefully some skilled guy or gal out there has a solution to this :D

Thanks anyway!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rahaug rahaug Joined 18 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.