spatie / laravel-settings

Store strongly typed application settings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot declare class after laravel-settings install

nyrik8989 opened this issue · comments

@php artisan package:discover --ansi
PHP Fatal error: Cannot declare class App\Modules\Partner\Providers\PartnerAuthServiceProvider, because the name is already in use in /home/user/www/lkozlaravel/app/Modules/Partner/app/Providers/PartnerAuthServiceProvider.php on line 15
[2021-03-29 19:05:03] local.ERROR: Cannot declare class App\Modules\Partner\Providers\PartnerAuthServiceProvider, because the name is already in use {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Cannot declare class App\Modules\Partner\Providers\PartnerAuthServiceProvider, because the name is already in use at /home/user/www/lkozlaravel/app/Modules/Partner/app/Providers/PartnerAuthServiceProvider.php:15)
[stacktrace]
#0 {main}
"}

"dont-discover": [
"spatie/laravel-settings"
]

ok

"repositories": [
{
"type": "path",
"url": "app/Modules/User",
"options": {
"symlink": true
},
"canonical": false
}, {

Hi @nyrik8989,

The settings package does not have a PartnerAuthServiceProvider, could you please try disabling the auto_discover_settings functionality of the package and see what that does?

composer.json

"dont-discover": [
"spatie/laravel-settings"
]

shell

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="settings"

config/settigs.php

'auto_discover_settings' => [
//todo вызывает ошибку
//app()->path(),
],

solved