Help for integrating the Laravel package
Forum rules: Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#1697 by davidlanier
21 Jul 2015, 13:39
I created a fresh install of Laravel 5.1.4, then modified the .env file and the composer.json file per the instructions at https://aimeos.org/docs/Laravel/Install_Aimeos, then ran composer update and received the following error:

Code: Select all> cp -r ext/*/client/extjs/deploy/* public/packages/aimeos/shop/client/extjs/deploy/
cp: cannot stat ‘ext/*/client/extjs/deploy/*’: No such file or directory
Script cp -r ext/*/client/extjs/deploy/* public/packages/aimeos/shop/client/extjs/deploy/ handling the post-update-cmd event returned with an error



  [RuntimeException]
  Error Output: cp: cannot stat ‘ext/*/client/extjs/deploy/*’: No such file or directory



I am the owner of the directories with full rwx permissions.
Should I continue with the Artisan commands?
#1699 by aimeos
21 Jul 2015, 16:47
Code: Select all> cp -r ext/*/client/extjs/deploy/* public/packages/aimeos/shop/client/extjs/deploy/
cp: cannot stat ‘ext/*/client/extjs/deploy/*’: No such file or directory
Script cp -r ext/*/client/extjs/deploy/* public/packages/aimeos/shop/client/extjs/deploy/ handling the post-update-cmd event returned with an error


Sorry, that "copy" line in the composer.json file doesn't work if no extensions are installed and I thought we removed this from the docs again (done now). Delete this line and try again, then it will work.
#1700 by davidlanier
21 Jul 2015, 17:20
Removing that line corrected the error, but I noticed that the syntax of the app.php providers array seems to have changed from what you are showing in your documentation.

You have:
Code: Select all    return array(

        'providers' => array(

            ...

            'Aimeos\Shop\ShopServiceProvider',

        ),

    );


However the syntax in 5.1.4 now is:
Code: Select all App\Providers\AppServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,
    Aimeos\Shop\ShopServiceProvider::class,


Anyway, now when running
Code: Select allphp artisan aimeos:setup --option=setup/default/demo:1
I get the following error:
Code: Select all [MW_DB_Exception]
  Executing statement "
                        SELECT DISTINCT lvu."id", lvu."name" as "label", lvu."name" as "code",
                                lvu."company", lvu."vatid", lvu."salutation", lvu."title",
                                lvu."firstname", lvu."lastname", lvu."address1",
                                lvu."address2", lvu."address3", lvu."postal", lvu."city",
                                lvu."state", lvu."countryid", lvu."langid",
                                lvu."telephone", lvu."email", lvu."telefax", lvu."website",
                                lvu."birthday", lvu."status", lvu."vdate", lvu."password",
                                lvu."created_at" AS "ctime", lvu."updated_at" AS "mtime", lvu."editor"
                        FROM "users" AS lvu

                        WHERE ( lvu."name" LIKE 'demo-%' )

                        LIMIT 100 OFFSET 0
                " failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'lvu.company' in 'field list'
#1701 by aimeos
21 Jul 2015, 17:53
davidlanier wrote:Removing that line corrected the error, but I noticed that the syntax of the app.php providers array seems to have changed from what you are showing in your documentation.


That's essentially the same, just another way to get the class name.

davidlanier wrote:Anyway, now when running
Code: Select allphp artisan aimeos:setup --option=setup/default/demo:1
I get the following error:
Code: Select all [MW_DB_Exception]
                " failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'lvu.company' in 'field list'


Someone else reported that problem before. Due to an unknown reason
Code: Select all            "php artisan vendor:publish",
            "php artisan migrate",

haven't been executed on "composer update". The first one should publish the database migration file to "./database/migrations" while the second one should execute the migrations so the missing fields are added. Can you check if both lines are in the "post-install-cmd" and "post-update-cmd" section of your composer.json file? They should be the first entries and the order is important too! Then run "composer update" and see if the Aimeos migration file is in "./database/migrations" and if the user table gets updated. If not, are the commands executed by composer at all?

Thanks
#1702 by davidlanier
21 Jul 2015, 18:15
I wasn't paying attention and just noticed that I have two publish directives in the post update section:

Code: Select all "post-install-cmd": [
            "php artisan vendor:publish",
            "php artisan migrate",
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan vendor:publish --tag=public --force",
            "php artisan vendor:publish",
            "php artisan migrate",
            "php artisan optimize"
        ],
#1703 by aimeos
21 Jul 2015, 18:43
davidlanier wrote:I wasn't paying attention and just noticed that I have two publish directives in the post update section:

Code: Select all        "post-update-cmd": [
            "php artisan vendor:publish --tag=public --force",
            "php artisan vendor:publish",
            "php artisan migrate",
            "php artisan optimize"
        ],


That's necessary because otherwise, the CSS and JS file won't get updated with new versions.

Does it work now if you execute "composer update" and afterwards "artisan aimeos:setup"?
#1705 by aimeos
21 Jul 2015, 19:09
davidlanier wrote:No. I'm still getting the unknown column lvu.company in the select statement.


Can you execute the following commands by hand:
Code: Select allphp artisan vendor:publish
php artisan migrate

Then, the user table should get updated. Check if
"./database/migrations/2015_03_06_000000_aimeos_users_table.php" is there and the migrations are executed.
#1706 by davidlanier
21 Jul 2015, 19:12
Sorry, I forgot to run the update first and you replied before I had a chance to edit my previous reply.

All is well now, except I'm getting a blank page when opening in my browser. I should have the demo right? I think I still need to make the csrf edits though.
#1707 by aimeos
21 Jul 2015, 19:24
davidlanier wrote:All is well now, except I'm getting a blank page when opening in my browser. I should have the demo right? I think I still need to make the csrf edits though.


Please continue with the setup. You need to add a base template, then you can test:
https://aimeos.org/docs/Laravel/Adapt_base_template
https://aimeos.org/docs/Laravel/Test_installation

The CSRF thing is necessary if you are using version 1.0.x to get through the checkout.