Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined property: stdClass::$column_name #1528

Closed
itelmenko opened this issue Aug 2, 2017 · 17 comments
Closed

Undefined property: stdClass::$column_name #1528

itelmenko opened this issue Aug 2, 2017 · 17 comments

Comments

@itelmenko
Copy link

  • Laravel Version: 5.4.31
  • Voyager Version: 0.11.14
  • PHP Version: PHP 7.1.4-1+deb.sury.org~xenial+1 (cli) (built: Apr 11 2017 22:12:32) ( NTS )
  • Database Driver & Version: mysql Ver 8.0.2-dmr for Linux on x86_64 (MySQL Community Server (GPL))

Description:

laradock@d347871da600:/var/www/laravel/voyager$ php artisan voyager:install --with-dummy
Publishing the Voyager assets, database, and config files
Copied Directory [/vendor/tcg/voyager/publishable/assets] To [/public/vendor/tcg/voyager/assets]
Copied Directory [/vendor/tcg/voyager/publishable/database/migrations] To [/database/migrations]
Copied Directory [/vendor/tcg/voyager/publishable/database/seeds] To [/database/seeds]
Copied Directory [/vendor/tcg/voyager/publishable/demo_content] To [/storage/app/public]
Copied File [/vendor/tcg/voyager/publishable/config/voyager.php] To [/config/voyager.php]
Publishing complete.
Copied File [/vendor/intervention/image/src/config/config.php] To [/config/image.php]
Publishing complete.
Migrating the database tables into your application

                                              
  [ErrorException]                            
  Undefined property: stdClass::$column_name  

Steps To Reproduce:

I just try to install voyager on clean laravel project. But I have such error

@itelmenko
Copy link
Author

The reason is database/migrations/2016_01_01_000000_add_voyager_user_fields.php
line

if (!Schema::hasColumn('users', 'avatar')) {

If I remove this condition I see next error:

....
Migrating: 2017_01_15_000000_create_permission_groups_table
Migrated:  2017_01_15_000000_create_permission_groups_table
Migrating: 2017_01_15_000000_make_table_name_nullable_in_permissions_table
Migrated:  2017_01_15_000000_make_table_name_nullable_in_permissions_table
Migrating: 2017_03_06_000000_add_controller_to_data_types_table
Migrated:  2017_03_06_000000_add_controller_to_data_types_table
Migrating: 2017_04_21_000000_add_order_to_data_rows_table
Migrated:  2017_04_21_000000_add_order_to_data_rows_table
Dumping the autoloaded files and reloading all new files
Adding Voyager routes to routes/web.php
Seeding data into the database

                                            
  [InvalidArgumentException]                
  Route [voyager.posts.index] not defined.  

If I try command php artisan voyager:install --with-dummy -vvv after this for details I have no errors:

Publishing the Voyager assets, database, and config files
Copied Directory [/vendor/tcg/voyager/publishable/assets] To [/public/vendor/tcg/voyager/assets]
Copied Directory [/vendor/tcg/voyager/publishable/database/migrations] To [/database/migrations]
Copied Directory [/vendor/tcg/voyager/publishable/database/seeds] To [/database/seeds]
Copied Directory [/vendor/tcg/voyager/publishable/demo_content] To [/storage/app/public]
Publishing complete.
Publishing complete.
Migrating the database tables into your application
Nothing to migrate.
Dumping the autoloaded files and reloading all new files
Adding Voyager routes to routes/web.php
Seeding data into the database
Adding the storage symlink to your public folder
The [public/storage] directory has been linked.
Successfully installed Voyager! Enjoy 🎉

@itelmenko
Copy link
Author

itelmenko commented Aug 4, 2017

UPDATE: I use laradock. Error was when I used mysql container (run as docker-compose up -d nginx php-fpm mysql workspace). If I use mariadb container (run docker-compose up -d nginx php-fpm mariadb workspace)

I have not such error. But I have error "Route [voyager.posts.index] not defined."

...

Migrating: 2017_04_21_000000_add_order_to_data_rows_table
Migrated:  2017_04_21_000000_add_order_to_data_rows_table
Dumping the autoloaded files and reloading all new files
Adding Voyager routes to routes/web.php
Seeding data into the database

                                            
  [InvalidArgumentException]                
  Route [voyager.posts.index] not defined.  

But after rerun php artisan voyager:install --with-dummy I don't see this error.

@ruudz
Copy link

ruudz commented Aug 10, 2017

I'm trying to install Voyager on clean Laravel project and am running into the same problem.

Publishing the Voyager assets, database, and config files
Copied Directory [/vendor/tcg/voyager/publishable/assets] To [/public/vendor/tcg/voyager/assets]
Copied Directory [/vendor/tcg/voyager/publishable/database/migrations] To [/database/migrations]
Copied Directory [/vendor/tcg/voyager/publishable/database/seeds] To [/database/seeds]
Copied Directory [/vendor/tcg/voyager/publishable/demo_content] To [/storage/app/public]
Publishing complete.
Publishing complete.
Migrating the database tables into your application

                                              
  [ErrorException]                            
  Undefined property: stdClass::$column_name  
                                              

After running php artisan voyager:install (also with dummy data).

@itelmenko
Copy link
Author

@ruudz , Do you use Laradock? What versions of mysql, php and laravel do you have?

@ruudz
Copy link

ruudz commented Aug 10, 2017

Yes, I'm using Laradock

  • Voyager Version: 0.11.14
  • Laravel: 5.4.*
  • MySQL: 8.0.2-dmr Linux(x86_64) MySQL Community Server (GPL)
  • PHP: 7.1.4-1+deb.sury.org~xenial+1 (cli) (built: Apr 11 2017 22:12:32) ( NTS )

@itelmenko
Copy link
Author

Did you try mariadb instead of mysql?

@ruudz
Copy link

ruudz commented Aug 10, 2017

Yes, but I'm getting an error which I think has to do with my config (never worked with mariadb).
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

@itelmenko
Copy link
Author

You need update the ".env" config: DB_HOST=mariadb

@ruudz
Copy link

ruudz commented Aug 10, 2017

Thanks, a voyager:install using mariadb now results in:

Publishing the Voyager assets, database, and config files
Copied Directory [/vendor/tcg/voyager/publishable/assets] To [/public/vendor/tcg/voyager/assets]
Copied Directory [/vendor/tcg/voyager/publishable/database/migrations] To [/database/migrations]
Copied Directory [/vendor/tcg/voyager/publishable/database/seeds] To [/database/seeds]
Copied Directory [/vendor/tcg/voyager/publishable/demo_content] To [/storage/app/public]
Publishing complete.
Publishing complete.
Migrating the database tables into your application
Migration table created successfully.
Migrating: <migrations>
Migrated:  <migrations>
Dumping the autoloaded files and reloading all new files
Adding Voyager routes to routes/web.php
Seeding data into the database

                                            
  [InvalidArgumentException]                
  Route [voyager.posts.index] not defined. 

@itelmenko
Copy link
Author

Yes, I have same error. But after rerun voyager:install it gone.

@ruudz
Copy link

ruudz commented Aug 10, 2017

Same here. Would be nice if it worked for mysql though.

@fletch3555
Copy link
Collaborator

There should be no issues with running MySQL, since that's what most of us maintainers use for our local dev environment. Though I don't think any of us are currently using LaraDock

@itelmenko
Copy link
Author

@fletch3555 What Mysql version do maintainers (and you) use?

@lancepioch
Copy link

Labels: invalid

Close (user error)

@itelmenko
Copy link
Author

It is not user's error. You can try it yourself in laradock. And you will see same error.

@ElioTohm
Copy link

found a temporary fix from the following laravel pull request
laravel/framework#21037
so basically in MySqlProcessor.php change column_name to upper case

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants