getting error on table create on database migration in laravel
your error can be something like this:- Syntax error or access violation:1071 Specified key was too long; max key length is 767 bytes
if you facing problem in creating table using database migration in laravel
then follow the steps:-
if you facing problem in creating table using database migration in laravel
then follow the steps:-
- Go to app -> Providers -> Edit AppServiceProvider.php
- Add given below line after use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
3. add this line Schema::defaultStringLength(191); in this given below function
public function boot()
{
}
Now you can run your database migration by this command 😅
php artisan migrate