Coder Social home page Coder Social logo

Comments (10)

MarekOtruba avatar MarekOtruba commented on August 16, 2024 3

@drbyte FIXED!

It's a bit complicated but, the app consists of 2 projects, soulcore is admin part, and when starting the main app, it has not started vendor autoload for soulcore, that's why libraries were not loaded but still existing. So I just need to call soulcore vendor autoload.php. Thanks for your advices and merry xmas!

from laravel-permission.

drbyte avatar drbyte commented on August 16, 2024 1

It's highly unusual to need to manually call vendor autoload.php. But sounds like your "2nd app" is disjointed from normal structure of composer-based apps.

from laravel-permission.

parallels999 avatar parallels999 commented on August 16, 2024

composer du

from laravel-permission.

drbyte avatar drbyte commented on August 16, 2024

from laravel-permission.

MarekOtruba avatar MarekOtruba commented on August 16, 2024

composer du

@parallels999
Didn't help, used php artisan cache:clear after composer du, still showing error.

from laravel-permission.

MarekOtruba avatar MarekOtruba commented on August 16, 2024

Post your composer.json file. Not the lock file.

@drbyte

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5|^8.3",
        "barryvdh/laravel-ide-helper": "^2.13",
        "bugsnag/bugsnag-laravel": "^2.21.0",
        "doctrine/dbal": "^3.0",
        "infyomlabs/adminlte-templates": "6.0.0",
        "infyomlabs/laravel-generator": "6.0.1",
        "intervention/image": "^2.5",
        "jenssegers/date": "^4.0",
        "kalnoy/nestedset": "^6.0",
        "kg-bot/laravel-localization-to-vue": "^2.1",
        "laracasts/utilities": "^3.0",
        "laravel/framework": "^10.37",
        "laravel/legacy-factories": "^1.1",
        "laravel/scout": "^10.6",
        "laravel/tinker": "^2.8",
        "laravel/ui": "^4.2",
        "owen-it/laravel-auditing": "^13.0",
        "prettus/l5-repository": "^2.7",
        "proengsoft/laravel-jsvalidation": "^4.4",
        "rap2hpoutre/laravel-log-viewer": "^2.3",
        "spatie/db-dumper": "^3.4",
        "spatie/laravel-html": "^3.3.0",
        "spatie/laravel-http-logger": "^1.2",
        "spatie/laravel-permission": "^6.2",
        "symfony/process": "^6.4.x-dev",
        "tightenco/ziggy": "^2.0.0-beta.2"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^7.0",
        "phpunit/phpunit": "^10.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "Soulcore\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "SoulDatabase\\Seeders\\": "database/seeders/"
            }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan ide-helper:generate",
            "php artisan ide-helper:meta"
        ]
    }
}

from laravel-permission.

drbyte avatar drbyte commented on August 16, 2024

Seems perhaps your composer cache is damaged.
Suggest:

rm -rf composer.lock vendor
composer install

from laravel-permission.

drbyte avatar drbyte commented on August 16, 2024

If that doesn't solve it, then please explain:

  • when did this error begin?
  • when did you install this package?

For example, you did not explain whether this is a brand new problem immediately after installing this package, or if it "suddenly" occurred after having been using the package in this app for long time.

To "test", I created a new Laravel app, then copied your composer.json into it, and ran composer update. It gave me some errors because of your custom Soulcore namespace, but changing it back to App got rid of the errors. And the trait works correctly when added to the User model.
So, either the problem is with your app and namespaces, or your composer vendor autoload cache is damaged.

If rebuilding the composer vendor autoload (by removing the lock file and the vendor dir and running composer install or composer update) doesn't solve it, then start creating a new Laravel app which demonstrates the problem, and share it on a github repo for inspection.

from laravel-permission.

MarekOtruba avatar MarekOtruba commented on August 16, 2024

@drbyte

Did you try to run the app? Because in PhpStorm everything is fine, import looks good, but when i try to log in to administration error pops out. But everything in IDE works. I tried remove lock file and vendor but it doesn't help.

image

from laravel-permission.

drbyte avatar drbyte commented on August 16, 2024

The screenshot from your IDE shows a lot of errors and warnings with the underlines: those underlines are always clues about things that need to be resolved.

from laravel-permission.

Related Issues (20)

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.