SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t oo long; max key length is 767 bytes
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
//add/edit the following into app/Providers/AppServiceProviders.php:
use Illuminate\Support\Facades\Schema;
function boot()
{
Builder::defaultStringLength(191); // Update defaultStringLength
}use Illuminate\Support\Facades\Schema;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
// Update your /app/Providers/AppServiceProvider.php to contain:
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
//ON this error
// PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists")
// After run -> php artisan migrate:fresh <- ! Note this will reset all tables in db
Also in PHP:
- associative array reverse php
- cheak type in php
- create new laravel project composer
- create migration model and seeder laravel
- PHP REDIRECTION
- db seed refresh
- create database seeder in laravel
- catch get error php
- check the length of the string in php
- Cache:: destroy laravel
- date('N') php
- crear seeder laravel 8
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; m ax key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`e mail`))
- composer in laravel
- borrar cache en laravel
- asia time zone in php
- aget date time in php
- PHP File Open/Read/Close
- count variable lenth in php
- array_reverse in php example
- check if string contains word
- find a word in a string php
- date(t) php
- !array_key_exists($id, $this->items)