Browsed by
Category: Laravel

Syntax Error or Access Violation: 1071 Specified Key Was Too Long

Syntax Error or Access Violation: 1071 Specified Key Was Too Long

This error is created by the default character set used by Laravel in database. Anyone using MySQL version older than the 5.7.7 release or MariaDB older than the 10.2.2 release need to manually configure default string length generated by migrations in order for MySQL to create indexes for them.  This issue is clearly addressed in Laravel documentation. SOLUTION 1 You need to add Schema::defaultStringLength in the boot function in your AppServiceProvider. use Illuminate\Support\Facades\Schema; /** *…

Read full Article Read More

Base Table or View Already Exists Laravel

Base Table or View Already Exists Laravel

If you are familiar with Laravel environment this might be the most common issue while migrating to database. This is caused by some kind of error during migration or incomplete migration before. As a result, incomplete tables are created in the database. And, if you try to migrate next time migration error (below or similar) will be thrown. I have encounter with similar kind of issue after I have fixed Syntax error or access violation:…

Read full Article Read More