liberu-genealogy / genealogy-laravel

Full genealogy application using Laravel 11, PHP 8.3, Filament 3.2 and Livewire 3.5
https://www.liberu.net
MIT License
114 stars 59 forks source link

Error during php artisan db:seed #65

Closed MGeurts closed 6 months ago

MGeurts commented 6 months ago

This is a bug.

Prerequisites

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 commented 6 months ago

Will look into this when I get my laptop working.

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

curtisdelicata commented 6 months ago

Should be fixed now I accidentally added the import twice