问题已经解决,需要安装
composer require vlucas/phpdotenv ^5.1.0
composer require illuminate/database ^8.0
controller/Index.php
<?php
namespace app\controller;
use support\Request;
use app\model\User;
class Index
{
public function index(Request $request)
{
return json(User::all());
}
}
model/User.php
<?php
namespace app\model;
use support\Model;
class User extends Model
{
protected $table = 'user';
protected $primaryKey = 'uid';
public $timestamps = false;
}
提示 Error: Class 'app\model\User' not found
改了是否重启webman
重启试过了