I have an Owner Model and an OwnerPresenter class. 'Standard' functionality os working fine. I am now trying to do something in a presenter part of which I will use in other presenters (but not all) so would like to utilise DI using a constructor in my Presenter Class. I get the following error:
Argument 1 passed to Owners\OwnerPresenter::__construct() must be an instance of Utilities\AddressBuilder, instance of Owners\Owner given, called in /home/vagrant/project1/vendor/laracasts/presenter/src/Laracasts/Presenter/PresentableTrait.php on line 29 and defined (View: /home/vagrant/project1/app/views/search.blade.php)
I have tried adding parent::_construct and parent::_construct($this->entity) but I am getting the same error.
I can see that there is a conflict with the constructors but struggling to work out how to solve it
I have an Owner Model and an OwnerPresenter class. 'Standard' functionality os working fine. I am now trying to do something in a presenter part of which I will use in other presenters (but not all) so would like to utilise DI using a constructor in my Presenter Class. I get the following error:
Argument 1 passed to Owners\OwnerPresenter::__construct() must be an instance of Utilities\AddressBuilder, instance of Owners\Owner given, called in /home/vagrant/project1/vendor/laracasts/presenter/src/Laracasts/Presenter/PresentableTrait.php on line 29 and defined (View: /home/vagrant/project1/app/views/search.blade.php)
I have tried adding parent::_construct and parent::_construct($this->entity) but I am getting the same error.
I can see that there is a conflict with the constructors but struggling to work out how to solve it