I'm running 'php artisan migrate' I got this error:
([Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))) after that In the AppServiceProvider.php
add this code
(use Illuminate\Support\Facades\Schema;and Schema::defaultStringLength(191);)
now I get another error
(PHP Fatal error: Cannot use Illuminate\Support\Facades
enter code here
\Schema as Schema because the name is already in use in C:\xampp\htdocs\projects\app\Providers\AppServiceProvider.php on line 7)
the following are the AppServiceProvider.php code
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use mysql_xdevapi\Schema;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
/**
* Register any application services.
*
* @return void
*/
public function register()`enter code here`
{
//
}
}
I would imagine you're getting this error because you've tried to import 2
Schema
classes.Try removing
use mysql_xdevapi\Schema;
from the top of yourAppServiceProvider
.