Cannot serve after installing
flymia opened this issue · comments
Marc commented
After I installed the package using the documentation, I get the following error when running php artisan serve
:
Exception
Error, configured model App\Models\User not exists
at vendor/jurager/teams/src/TeamsServiceProvider.php:90
86▕ throw new Exception('Error, missing '.$model.' model configuration');
87▕ }
88▕
89▕ if (! class_exists(config('teams.models.'.$model))) {
➜ 90▕ throw new Exception('Error, configured model '.config('teams.models.'.$model).' not exists');
91▕ }
92▕
93▕ Teams::setModel($model, config('teams.models.'.$model));
94▕ }
+8 vendor frames
9 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
+5 vendor frames
15 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
My User Model looks the following:
<?php
namespace App\Models;
namespace App\Providers;
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 Jurager\Teams\Traits\HasTeams;
class User extends Authenticatable
{
use HasTeams, HasApiTokens, HasFactory, Notifiable;
...
What am I missing?
Yuri commented
Seems you have a problem with your User model. In provided User model I see wrong namespace definition
namespace App\Models;
namespace App\Providers;
You should use only App\Models, remove line with App\Providers