Class 'Illuminate\Support\facades\Schema' not found

后端 未结 7 1832
终归单人心
终归单人心 2021-01-29 05:25

I am working with Laravel5.4. When I use socialite package to login with Facebook, I need to add this line of

Schema::defaultStringLength(191);
<
7条回答
  •  悲哀的现实
    2021-01-29 05:41

    You must set the .env file This setting

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=ilk
    DB_USERNAME=root
    DB_PASSWORD=
    

    in app/Providers/AppServiceProvider.php

    n

    amespace App\Providers;
    
    use Illuminate\Support\ServiceProvider;
    //hata almamak ıcın
    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()
        {
            //
        }
    }
    

提交回复
热议问题