無法發布到 phpmyadmin。在當地工作。總體而言,該站點路由良好。我嘗試將模型添加到 auth.php 文件中,并更改 user.php 中的命名空間以包含其他論壇以及 stackoverflow 中建議的模型。這不起作用。我在網絡選項卡中收到以下錯誤:{message: "Class 'APP\User' not found", exception: "Error",…}exception: "Error"file: "C:\laragon\www\crm\app\Http\Controllers\API\UserController.php"line: 31message: "Class 'APP\User' not found"trace: [{function: "store", class: "App\Http\Controllers\API\UserController", type: "->"},…]這是我現在的文件:用戶.php<?phpnamespace App;use Illuminate\Contracts\Auth\MustVerifyEmail;use Illuminate\Foundation\Auth\User as Authenticatable;use Illuminate\Notifications\Notifiable;class User extends Authenticatable{ use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', 'bio', 'photo', 'type' ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ];}auth.php 中的身份驗證提供者部分 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, ],我正在使用 Laravel 學習 VueJs 的舊教程,但他們使用的是 Laravel 5.7,而我使用的是 Laravel 7。我確信很多事情都發生了變化,所以如果有人可以為此提供一些幫助,我肯定會很感激。先感謝您。
- 1 回答
- 0 關注
- 121 瀏覽
添加回答
舉報
0/150
提交
取消