in my Laravel 9 project, the model does not retrieve users' data from the table, probably because it extends authenticatable instead of Model. and when I changed that, the authentication did not work. Here is my model:
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Illuminate\Database\Eloquent\Casts\Attribute;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
}
?>
I tried the controller and view code on another model and it worked. what would the problem be?
I was trying to display records of users table but it keeps giving me the error Undefined variable $users. I'm using Route::resource