Я пытаюсь сделать простой вход в систему только на мгновение, и когда я пытаюсь войти, я получаю эту ошибку
Cannot declare class App\Models\User, because the name is already in use
В моей пользовательской модели это модель
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
protected $fillable = [
'username', 'password',
];
protected $hidden = [
'password', 'remember_token',
];
protected $casts = [
'email_verified_at' => 'datetime',
];
}
В этой строке говорится об ошибке
class User extends Authenticatable
Это мой метод отправки в Login.vue
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
this.$inertia.post('/login', {
username: this.form.username,
password: this.form.password,
}).then(() => this.loading = false)
} else {
return false;
}
});
},
Что я делаю не так?