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

Errorhandling with laravel V3 models "Cannot redeclare non static..." #48

Closed
half-evil opened this issue Dec 26, 2013 · 3 comments
Closed

Comments

@half-evil
Copy link

Hi,

this is only an enhancement, not a real issue. As I'm upgrading my laravel framework from V3 to V4, Iinstalled your very handy tools (thank you for them) and ran into this issue: With Eloquent models V3 you have to declare the table property as public static, now with V4 as protected. If you are not aware of this, php artisan ide-helper:models your-model leads to a 'nice' PHP Fatal error: Cannot redeclare non static Illuminate\Database\Eloquent\Model::$table as static Your-model::$table in ....
Maybe you could add a warning in your readme. And if not, from now on everybody else will know how to solve the error by themselfs :-)

Happy coding

@barryvdh
Copy link
Owner

But wouldn't it throw an error anyways when you first try to you use your model? So not really an issue with the command..

@half-evil
Copy link
Author

Yes, your right. After looking at the stack trace I saw, that it's laravel throwing the exception, not your code.

@tientruong
Copy link

change public static by protected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants