Laravel 5.8: A facade root has not been set after homestead restart

不羁的心 提交于 2020-01-01 19:08:06

问题


so I'm trying to get into Laravel and this is my first time using Vagrant, so here's my problem:

I've worked through the Laravel Homestead introduction and set up my development box, everything appears to be working and I did see the Laravel default app.When wrapping up the day I've stopped the local vagrant using vagrant halt and tried starting it again using vagrant up as before and then I'm receiving the

"( ! ) Fatal error: Uncaught RuntimeException: A facade root has not been set. in /home/vagrant/code/laravel/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 234"

Message when trying to reach my Laravel app. Since this also happens for a completely new project, I assume that I'm missing something very basic, could anyone tell me how to handle Vagrant so that I can still reach my project after restarting the virtual machine?

I did not write any code except initially creating the Laravel application via composer, the error does not pop up because I'm trying to use something and am doing it wrong. I am using the default state of a new application and it pops up.


回答1:


Ran into this issue because the default laravel/homestead box installed via vagrant is set to v8.0.0-alpha2 which seems to be very broken. You will need to reinstall the box and delete the current box.

Reference: https://github.com/laravel/homestead/issues/1178

cd ~/Homestead
vagrant destroy
vagrant box remove laravel/homestead --box-version=8.0.0-alpha2
vagrant box add laravel/homestead --box-version=7.2.1
vagrant up



回答2:


as the same of the answer top of me by @Cody Moorhouse

but in my case did,t work till i did this :

before run the box up i added version:7.2.1 to homstead.ymal

ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
version: 7.2.1
authorize: ~/.ssh/id_rsa.pub

and i edited the compser.json and added

"extra_data":{  
        "box":{  
           "name":"laravel/homestead",
           "provider":"virtualbox",
           "version":"dev-release"
        }
     },

to force vagrant to use the version 7.2.1

then on homestead dirctory i lunched compsoer update

after that vagrant up work perfect .



来源:https://stackoverflow.com/questions/56456595/laravel-5-8-a-facade-root-has-not-been-set-after-homestead-restart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!