Giter VIP home page Giter VIP logo

Comments (13)

DarkGhostHunter avatar DarkGhostHunter commented on August 16, 2024

Did you dump your autoload?

Laraguard doesn't uses require to pick up the models, it just infers them using PSR-4. The only require used is from the settings.php.

The stack trace should give you all the details.

from laraconfig.

lukas-pierce avatar lukas-pierce commented on August 16, 2024

Yes, I regenerated autoload file

composer dump-autoload

Sorry cannot show stack trace because removed your package from project, but I discovered sources and take the your models, chic architecture.

from laraconfig.

lukebouch avatar lukebouch commented on August 16, 2024

I'm having the same problem.

php artisan settings:migrate


   Symfony\Component\ErrorHandler\Error\FatalError

  Cannot declare class App\Models\User, because the name is already in use

  at app/Models/User.php:15
     11▕ use Silber\Bouncer\BouncerFacade;
     12▕ use Silber\Bouncer\Database\HasRolesAndAbilities;
     13▕ use Silber\Bouncer\Database\Role;
     14▕
  ➜  15▕ class User extends Authenticatable
     16▕ {
     17▕     use HasFactory, Notifiable, HasRolesAndAbilities;
     18▕
     19▕     /**


   Whoops\Exception\ErrorException

  Cannot declare class App\Models\User, because the name is already in use

  at app/Models/User.php:15
     11▕ use Silber\Bouncer\BouncerFacade;
     12▕ use Silber\Bouncer\Database\HasRolesAndAbilities;
     13▕ use Silber\Bouncer\Database\Role;
     14▕
  ➜  15▕ class User extends Authenticatable
     16▕ {
     17▕     use HasFactory, Notifiable, HasRolesAndAbilities;
     18▕
     19▕     /**

      +1 vendor frames
  2   [internal]:0
      Whoops\Run::handleShutdown()

from laraconfig.

eafarooqi avatar eafarooqi commented on August 16, 2024

i also have the same issue, but only on Linux, on windows, i don't have this issue. still no fix to this issue?

from laraconfig.

eafarooqi avatar eafarooqi commented on August 16, 2024

This is what i get in the log file

[2021-09-27 20:50:32] staging.ERROR: Cannot declare class App\Models\Administration\Region, because the name is already in use {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Cannot declare class App\\Models\\Administration\\Region, because the name is already in use at /var/www/twap/app/Models/Administration/Region.php:10)
[stacktrace]
#0 {main}
"} 

from laraconfig.

illusive-ch avatar illusive-ch commented on August 16, 2024

Same issue here @DarkGhostHunter

from laraconfig.

DarkGhostHunter avatar DarkGhostHunter commented on August 16, 2024

Hands full and overtime guys, you will have to sit this one out.

from laraconfig.

eafarooqi avatar eafarooqi commented on August 16, 2024

@DarkGhostHunter #26 Please merge, this should fix the issue.

from laraconfig.

ricventu avatar ricventu commented on August 16, 2024

Same issue here, with traits

from laraconfig.

renepardon avatar renepardon commented on August 16, 2024

I have the same problem with my User model:

PHP Fatal error:  Cannot declare trait App\Models\Traits\Encryptable, because the name is already in use in /var/www/html/app/Models/Traits/Encryptable.php on line 9

   Symfony\Component\ErrorHandler\Error\FatalError

  Cannot declare trait App\Models\Traits\Encryptable, because the name is already in use

  at app/Models/Traits/Encryptable.php:9
      5▕ use Illuminate\Contracts\Encryption\DecryptException;
      6▕ use Illuminate\Contracts\Encryption\EncryptException;
      7▕ use Illuminate\Support\Facades\Crypt;
      8▕
  ➜   9▕ trait Encryptable
     10▕ {

My user model looks like that:

class User extends Authenticatable implements MustVerifyEmail
{
    use HasApiTokens;
    use HasFactory;
    use HasProfilePhoto;
    use Notifiable;
    use TwoFactorAuthenticatable;
    use HasRoles;
    use HasConfig;

So I dont even use the Encryptable trait on the user model itself and it's really only declared once in my application. I called artisan optimize and composer dump-autoload without success

from laraconfig.

renepardon avatar renepardon commented on August 16, 2024

Is there maybe an alternative to use the settings without "migration" command in the meantime?

from laraconfig.

ricventu avatar ricventu commented on August 16, 2024

Are you updated with latest master?

this commit must fix that

from laraconfig.

renepardon avatar renepardon commented on August 16, 2024

Are you updated with latest master?

this commit must fix that

I usually don't install master or dev versions in production code. The latest available version 1.3.5 is 6 months old. Therefore I guess I need to wait for the next version ;)

from laraconfig.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.