文件名有一条红色波浪线,但我没有看到在我创建的类中弹出错误。这是PHPStorm的错误吗?没有迹象表明我错过了什么。并且悬停在红线上并不会显示更多信息。
<?php
namespace App\Classes;
use App\Events\EventGenerator;
use Illuminate\Database\Eloquent\Model;
use App\Classes\User;
class User extends Model {
use EventGenerator;
// Define Table Setup with fillabe fields
protected $table = 'users';
protected $fillable = ['name', 'user_reference', 'first_name', 'last_name', 'user_type_id', 'created_at', 'updated_at'];
public $timestamps = true;
// Set class properties
public function set($data) {
foreach ($data as $key => $value) {
$this->{$key} = $value;
}
return $this;
}
public function getAllUsers() {
$responders = User::all();
return $responders;
}
public function getUser($userReference) {
$user = User::where('user_reference', '=', $userReference)->first();
return $user;
}
}