Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#2796 by overmountainstudios
17 May 2016, 14:04
I've just installed and configured the demo for aimeos on Laravel 5.2. It looks good and mostly works, but there's a strange issue that I'm not sure how to resolve. If I attempt to add an item to my cart as a user, I get the following error:
Code: Select allFatalErrorException in Base.php line 0:
Declaration of Aimeos\MShop\Service\Provider\Decorator\Base::__construct(Aimeos\MShop\Service\Provider\Iface $provider, Aimeos\MShop\Context\Item\Iface $context, Aimeos\MShop\Service\Item\Iface $serviceItem) must be compatible with Aimeos\MShop\Service\Provider\Factory\Iface::__construct(Aimeos\MShop\Context\Item\Iface $context, Aimeos\MShop\Service\Item\Iface $serviceItem)
in Base.php line 0

This happens regardless of which product that I attempt to add to the basket. Does anyone know why this could be happening? Did I miss a configuration step?
#2798 by overmountainstudios
17 May 2016, 16:30
You are absolutely right. I'm hosting it on a Laravel Homestead vagrant box, and that vagrant image seems to use an older version of PHP7. I had to
Code: Select allsudo apt upgrade php


I was also encountering issues with apt not being able to find the official PHP PPA. For anyone encountering this issue, the PPA seems to have changed names. I did the following to fix it:
Code: Select allsudo vim /etc/apt/sources.list.d/ondrej-php-7_0-trusty.list

and I changed
Code: Select alldeb http://ppa.launchpad.net/ondrej/php-7.0/ubuntu trusty main

to
Code: Select alldeb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main


After that, I ran
Code: Select allsudo apt update

and I was able to update php without issue.