I’m just starting out with my Laravel project for a subject I have on uni and so far I’ve been transferring my whole project between those two PCs without any issues, but last time I tried out migrations something interesting happened.
On my laptop at home everything went through fine, it migrated to phpMyAdmin and I saw the columns having the right values for modifiers. When I transferred the next day my project to uni I saw that when I tried to migrate it suddenly gave me a few (easily fixable) errors. Things like string length being too long or description type column not being able to have a default value like I defined.
So my question is: What could be the issue for my project at home not showing those errors, when the exact same project at uni doesn’t let me migrate before I fix it all? I work in the same IDE on both PCs (PhpStorm – same version, same account) and both Laravel versions are 6.6.0.
I just want to be sure that I’m not doing mistakes and I can fix my errors at home, not in front of my teacher while giving it to grade it.
Thanks for help
Edit:
Those two lines for example are the ones causing problems on my uni pc, yet at home it goes through without any problems. The error I get are just simple things, something like “key value too long” (for the name column) or “no default value allowed for description type columns”
$table->string('name',200)->unique();
$table->text('description')->nullable(true)->default('No description.');
2
Answers
Sounds like you have different PHP or Apache/Nginx versions installed with different configurations, maybe even showing notices for development state. You should try to set up the same server side configuration or consider to use Docker that works across devices as a container system.
Edit file
app/Providers/AppServiceProvider.php
inside theboot
method change it to:For more information, go to this thread https://laravel-news.com/laravel-5-4-key-too-long-error