Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during php artisan db:seed #65

Closed
3 of 4 tasks
MGeurts opened this issue Mar 3, 2024 · 2 comments
Closed
3 of 4 tasks

Error during php artisan db:seed #65

MGeurts opened this issue Mar 3, 2024 · 2 comments

Comments

@MGeurts
Copy link

MGeurts commented Mar 3, 2024

This is a bug.

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you check the documentation?
  • Did you perform a cursory search?

Description

Installing the application throws an error.

Steps to Reproduce

  1. Manual execute the commands contained in setup.sh in terminal : php artisan db:seed

Expected behavior

A successfull installation

Actual behavior

Error:

` INFO Seeding database.

Symfony\Component\ErrorHandler\Error\FatalError

Cannot use Illuminate\Foundation\Auth\User as Authenticatable because the name is already in use

at app\Models\User.php:13
9▕ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
10▕ use Illuminate\Foundation\Auth\User as Authenticatable;
11▕ use Illuminate\Support\Collection;
12▕ use Illuminate\Database\Eloquent\Factories\HasFactory;
➜ 13▕ use Illuminate\Foundation\Auth\User as Authenticatable;
14▕ use Illuminate\Notifications\Notifiable;
15▕ use Laravel\Sanctum\HasApiTokens;
16▕
17▕ class User extends Authenticatable implements FilamentUser, HasTenants

Whoops\Exception\ErrorException

Cannot use Illuminate\Foundation\Auth\User as Authenticatable because the name is already in use

at app\Models\User.php:13
9▕ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
10▕ use Illuminate\Foundation\Auth\User as Authenticatable;
11▕ use Illuminate\Support\Collection;
12▕ use Illuminate\Database\Eloquent\Factories\HasFactory;
➜ 13▕ use Illuminate\Foundation\Auth\User as Authenticatable;
14▕ use Illuminate\Notifications\Notifiable;
15▕ use Laravel\Sanctum\HasApiTokens;
16▕
17▕ class User extends Authenticatable implements FilamentUser, HasTenants

1 vendor\filp\whoops\src\Whoops\Run.php:510
Whoops\Run::handleError("Cannot use Illuminate\Foundation\Auth\User as Authenticatable because the name is already in use", "D:\LARAGON\www\genealogy-laravel\app\Models\User.php")

2 [internal]:0
Whoops\Run::handleShutdown()
`

This is due to an error in app\Models\User.php : use Illuminate\Foundation\Auth\User as Authenticatable; is mentioned twice.

When removing the second use Illuminate\Foundation\Auth\User as Authenticatable; the following error occures during issuing the command php artisan db:seed :

` INFO Seeding database.

Symfony\Component\ErrorHandler\Error\FatalError

Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Filament\Models\Contracts\FilamentUser::canAccessPanel)

at app\Models\User.php:16
12▕ use Illuminate\Notifications\Notifiable;
13▕ use Illuminate\Support\Collection;
14▕ use Laravel\Sanctum\HasApiTokens;
15▕
➜ 16▕ class User extends Authenticatable implements FilamentUser, HasTenants
17▕ {
18▕ use HasApiTokens, HasFactory, Notifiable;
19▕
20▕ /**

Whoops\Exception\ErrorException

Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Filament\Models\Contracts\FilamentUser::canAccessPanel)

at app\Models\User.php:16
12▕ use Illuminate\Notifications\Notifiable;
13▕ use Illuminate\Support\Collection;
14▕ use Laravel\Sanctum\HasApiTokens;
15▕
➜ 16▕ class User extends Authenticatable implements FilamentUser, HasTenants
17▕ {
18▕ use HasApiTokens, HasFactory, Notifiable;
19▕
20▕ /**

1 vendor\filp\whoops\src\Whoops\Run.php:510
Whoops\Run::handleError("Class App\Models\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Filament\Models\Contracts\FilamentUser::canAccessPanel)", "D:\LARAGON\www\genealogy-laravel\app\Models\User.php")

2 [internal]:0
Whoops\Run::handleShutdown()`

@curtisdelicata
Copy link
Contributor

Will look into this when I get my laptop working.

Any idea, @curtisdelicata @boscan-alexandru @Alain-Kay @AArchange

@curtisdelicata
Copy link
Contributor

Should be fixed now I accidentally added the import twice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants