Comments (10)
@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.
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.
composer du
from laravel-permission.
from laravel-permission.
composer du
@parallels999
Didn't help, used php artisan cache:clear after composer du, still showing error.
from laravel-permission.
Post your composer.json file. Not the lock file.
{
"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.
Seems perhaps your composer cache is damaged.
Suggest:
rm -rf composer.lock vendor
composer install
from laravel-permission.
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.
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](https://private-user-images.githubusercontent.com/15228518/291822249-421942ac-79ee-4d17-abbd-5a2645fd170c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwMDY1OTAsIm5iZiI6MTcyMDAwNjI5MCwicGF0aCI6Ii8xNTIyODUxOC8yOTE4MjIyNDktNDIxOTQyYWMtNzllZS00ZDE3LWFiYmQtNWEyNjQ1ZmQxNzBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDExMzEzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5OTZkOTY4NDI1YjcyYTc2ZDM5MDE3NTk0MGFlODc2ZjI5N2VmOGRkMDFkZDIzZjIwYTQ2ZTYyMjFmNDVlMDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KfFQw1UNtZ1NizzSGoZKnLbsSxRH4dUbJlxNx9CGjCA)
from laravel-permission.
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)
- Too much Role-Models loaded HOT 3
- Enums shouldn't be casted in the model HOT 8
- assignRole > getModel() > null
- Timestamps in migration for sql server HOT 4
- Target class [Spatie\Permission\Middlewares\PermissionMiddleware] does not exist. HOT 2
- DOCS - Side menu dissapeared HOT 4
- Problem upgrading with existing data permissions/roles HOT 1
- Cannot save the user model twice in the same request HOT 10
- withoutPermission scope from HasPermissions returns users from outside the team HOT 3
- Laravel 11 compatibility issues HOT 5
- Problem with middleware definition method in the controller in Laravel 11
- Problem with denied access using the middleware aliases role, permission, and role_or_permission in Spatie Permission version 6 and higher. HOT 2
- Problem when trying to migrate laravel-permission migrations HOT 2
- Docs are not uptodate with current implementation HOT 9
- Diffs are not properly displayed in generated docs HOT 4
- Bug @can OR $user->can OR $user->hasAnyPermission($permission) HOT 1
- Problems giving permissions to a role when the id field is a uuid type HOT 4
- Can't define "Super User" for each guard
- Custom user menu item not being translated HOT 1
- Fix PHPStan failure: Access to an undefined property Illuminate\Database\Eloquent\Model::$name.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-permission.