-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Fatal error: Cannot redeclare getModelForGuard() #9
Comments
Using both spatie/permission and konekt/acl is not supported. Since the two are the same, what is the benefit of using both? |
Basically i'm looking for a package to use for cart and other components of eCommerce (order, checkout, coupons) with active development going on and possibility of getting support for it, for that vanilo framework fit the bill. I tried installing cart separately as a package but it didn't published the resources (config, migrations) in Laravel 5.5. So i tried to install the framework but i got the following issue and saw that vanilo is using the modified version of spatie/permission which i'm already using it for handling user roles and permissions in my application. Right now we are using "spatie/laravel-permission": "^2.7" |
If you want to use just the components, then go without the framework. Let's see the other issue regarding to config/migrations. This one I'll close |
I've added the solution for vanilophp/cart#3 |
…thod protected on the Cart model Fixes #9
Hi,
I'm getting the following issue when using spatie/laravel-permission and vanillo/framework together.
PHP Fatal error: Cannot redeclare getModelForGuard() (previously declared in C:....\vendor\konekt\acl\src\Support\helpers.php:8) in C:....\vendor\spatie\laravel-permission\src\helpers.php on line 14
I can see that konekt/acl is a modified version of spatie/laravel-permission package, and @fulopattila122 you are also one of the authors konekt/acl
Since both the definition and functionality is same so this issue can be avoided if following solution is implemented.
if(!function_exists('getModelForGuard') {
function getModelForGuard(string $guard)
{
return collect(config('auth.guards'))
->map(function ($guard) {
return config("auth.providers.{$guard['provider']}.model");
})->get($guard);
}
}
or rename the function from getModelForGuard to getGuardModel
Thanks.
The text was updated successfully, but these errors were encountered: