从一个新项目开始:
laravel new new-project
cd new-project
touch storage/database/database.sqlite
然后在 .env
DB_CONNECTION=sqlite
DB_DATABASE=storage/database/database.sqlite
DB_FOREIGN_KEYS=true
迁移成功...
php artisan migrate
php artisan tinker
>>>App\User::all()
但是当我尝试获取所有用户时,它会返回以下错误:
PHP Fatal error: Class 'App/User' not found in Psy Shell code on line 1
我可能会错过什么?