My user model like this :
namespace App\Models\Auth;
...
class User extends Authenticatable
{
...
public function vendor()
{
return $this->belongsTo(Vendor::class, 'vendor_id', 'id');
}
}
My vendor model like this :
namespace App\Models;
...
class Vendor extends Model
{
...
public function users()
{
return $this->hasMany(User::class, 'id', 'vendor_id');
}
}
If the relation run, there exist error like this :
Class 'App\Models\Auth\Vendor' not found
It seems that the error occurred because the vendor model is not in the auth folder
How do I solve that error without moving the vendor model to the auth folder?