New Laravel Installation

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
archmaster
Posts: 6
Joined: 30 Aug 2018, 00:36

New Laravel Installation

Post by archmaster » 30 Aug 2018, 02:56

Local Installation
Laravel 5.4.36
"aimeos/aimeos-laravel": "~2018.07"
Apache PHP 5.6.25
Windows 10
---------
I am following the directions as posted in github: https://github.com/aimeos/aimeos-larave ... el-package for a fresh installation of aimeos, and all is going well until I get to the step:

Code: Select all

php artisan aimeos:setup --option=setup/default/demo:1
, where I get the following:
In Simple.php line 97:
An exception occurred while executing 'ALTER TABLE users_address ADD CONSTRAINT fk_lvuad_pid FOREIGN KEY (parentid) REFERENCES users (id) ON UPDATE CASCADE ON DELETE CASCADE':
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
Since that stops the batch execution, the tables remain empty, no demo data is shown.

Then when visiting the link: http://127.0.0.1:8000/index.php/list, I get the following:
(1/1) Exception
No item found for conditions: Array
(
[locale.site.code] => default
)
I have deleted the users_address table, as suggested in: post6396.html#p6344, to no avail, the same exception keeps showing up.

Any help will be greatly appreciated.

User avatar
aimeos
Administrator
Posts: 3635
Joined: 01 Jan 1970, 00:00

Re: New Laravel Installation

Post by aimeos » 30 Aug 2018, 07:04

Can you post the output of

Code: Select all

SHOW CREATE TABLE users
and

Code: Select all

SHOW CREATE TABLE users_address
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

archmaster
Posts: 6
Joined: 30 Aug 2018, 00:36

Re: New Laravel Installation

Post by archmaster » 30 Aug 2018, 18:22

Of course. This is the output:

Local Databases/ http://localhost/phpmyadmin/server_sql. ... 59e25817c9
Su consulta se ejecutó con éxito.
SHOW CREATE TABLE myshop.users

users CREATE TABLE `users` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
 `created_at` datetime NOT NULL,
 `updated_at` datetime NOT NULL,
 `superuser` smallint(6) NOT NULL DEFAULT '0',
 `siteid` int(11) DEFAULT NULL,
 `label` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `salutation` varchar(8) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `company` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `vatid` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `title` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `firstname` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `lastname` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `address1` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `address2` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `address3` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `postal` varchar(16) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `city` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `state` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `langid` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
 `countryid` char(2) COLLATE utf8_unicode_ci DEFAULT NULL,
 `telephone` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `telefax` varchar(32) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `website` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 `longitude` decimal(8,6) DEFAULT NULL,
 `latitude` decimal(8,6) DEFAULT NULL,
 `birthday` date DEFAULT NULL,
 `vdate` date DEFAULT NULL,
 `status` smallint(6) NOT NULL DEFAULT '1',
 `editor` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
 PRIMARY KEY (`id`),
 UNIQUE KEY `users_email_unique` (`email`),
 KEY `idx_lvusr_langid` (`langid`),
 KEY `idx_lvusr_last_first` (`lastname`,`firstname`),
 KEY `idx_lvusr_post_addr1` (`postal`,`address1`),
 KEY `idx_lvusr_post_city` (`postal`,`city`),
 KEY `idx_lvusr_lastname` (`lastname`),
 KEY `idx_lvusr_address1` (`address1`),
 KEY `idx_lvusr_city` (`city`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

________

Local Databases/ http://localhost/phpmyadmin/server_sql. ... 59e25817c9
Su consulta se ejecutó con éxito.

SHOW CREATE TABLE myshop.users_address

users_address CREATE TABLE `users_address` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `parentid` int(11) NOT NULL,
 `siteid` int(11) NOT NULL,
 `company` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
 `vatid` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
 `salutation` varchar(8) COLLATE utf8_unicode_ci NOT NULL,
 `title` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
 `firstname` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
 `lastname` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
 `address1` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
 `address2` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
 `address3` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
 `postal` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
 `city` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
 `state` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
 `langid` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
 `countryid` char(2) COLLATE utf8_unicode_ci DEFAULT NULL,
 `telephone` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
 `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `telefax` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `website` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `longitude` decimal(8,6) DEFAULT NULL,
 `latitude` decimal(8,6) DEFAULT NULL,
 `flag` int(11) NOT NULL,
 `pos` smallint(6) NOT NULL,
 `mtime` datetime NOT NULL,
 `ctime` datetime NOT NULL,
 `editor` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 PRIMARY KEY (`id`),
 KEY `idx_lvuad_pid` (`parentid`),
 KEY `idx_lvuad_last_first` (`lastname`,`firstname`),
 KEY `idx_lvuad_post_addr1` (`postal`,`address1`),
 KEY `idx_lvuad_post_city` (`postal`,`city`),
 KEY `idx_lvuad_address1` (`address1`),
 KEY `idx_lvuad_city` (`city`),
 KEY `idx_lvuad_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci


Hope it´s helpful.

User avatar
aimeos
Administrator
Posts: 3635
Joined: 01 Jan 1970, 00:00

Re: New Laravel Installation

Post by aimeos » 30 Aug 2018, 21:02

Your table definition seems to be OK, user.id and users_address.parentid are of the same type and length. Do you have any parent IDs in users_address that are not present in the users table any more?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

archmaster
Posts: 6
Joined: 30 Aug 2018, 00:36

Re: New Laravel Installation

Post by archmaster » 30 Aug 2018, 22:42

No. I don´t think so. It is a fresh installation and I have not done any modifications. Ultimately all I am doing is running the script:
php artisan aimeos:setup --option=setup/default/demo:1

I have repeated the whole process several times from the start, always getting the same result.

mohal_04
Advanced
Posts: 108
Joined: 27 Mar 2018, 05:59

Re: New Laravel Installation

Post by mohal_04 » 31 Aug 2018, 06:22

Why are you not installing it on Laravel 5.6?

archmaster
Posts: 6
Joined: 30 Aug 2018, 00:36

Re: New Laravel Installation

Post by archmaster » 31 Aug 2018, 14:37

Well, I am following the instructions to the letter, so I am using this line as is, for the laravel installation:
composer create-project --prefer-dist laravel/laravel myshop

archmaster
Posts: 6
Joined: 30 Aug 2018, 00:36

Re: New Laravel Installation

Post by archmaster » 01 Sep 2018, 02:21

So I updated my development environment, like so:
Local Installation
Laravel 5.6.35
"aimeos/aimeos-laravel": "~2018.07"
Apache PHP 7.2.9
Windows 10

But still got the exact same result. Any thoughts??

User avatar
aimeos
Administrator
Posts: 3635
Joined: 01 Jan 1970, 00:00

Re: New Laravel Installation

Post by aimeos » 01 Sep 2018, 13:54

Your "users" table is of type "MyISAM" instead of "InnoDB" and foreign key constraints only work with "InnoDB". This might be caused by a database server default setting. Which MySQL database version do you use?

Change the engine of the users table to "InnoDB", then it will work.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

archmaster
Posts: 6
Joined: 30 Aug 2018, 00:36

Re: New Laravel Installation

Post by archmaster » 01 Sep 2018, 17:47

Your are right. It´s working perfectly now!

Thanks a lot guys!

Post Reply