-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Spatie Team Enabled Issues #42
Comments
To fix this issue, I had to add a check to the LaravelCrmInstall.php file
|
Part 2 of the teams enabled bug |
Steps we did to fix this issue
|
Create middleware
use Closure; class CheckCustomPermission
} Replace |
Edit User Model public function team()
` |
Update app/Providers/AuthServiceProvider.php
|
(config('laravel-crm.teams') && auth()->user()->currentTeam && auth()->user()->currentTeam->user_id == auth()->user()->id currentTeam function was not working so I update it like so and on the where I replace it |
For the middle ware to work each one needs to check |
https://github.com/Lemnocity/clean-crm here is the link to our clean crm project |
Thanks for reporting this. So there are a few issues here. I built the teams function basically to use with Laravel Jetstream, which has a Teams feature. This is then used to create multi-tenant applications. So as it stands right now you need to be using Jetstream. I have this working myself in a few projects, however what we need to do is allow for projects that don't use Jetstream. And also I should probably create a few variations of the starter project to make use of Breeze vs Jetstream vs Custom. Also you have made me aware that the installer will not work with teams, I will need to update that. Now I think this might be a little confusing, but the "Teams" in the CRM are not the same thing as "teams" in Jetstream. Teams in the CRM are teams of people, say "Sales Team", "Accounts Team", etc Where as Teams in Jetstream, are seperate tenants in the project. "Company A", "Company B", etc |
Description:
Enabling Spatie teams breaks role and permissions model.
Steps To Reproduce:
Enable Teams in the env file
LARAVEL_CRM_TEAMS=true
Run artisan command: php artisan laravelcrm:install
Enter first name
Enter last name
Enter email address
Enter password
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'team_id' cannot be null (Connection: mysql, SQL: insert into
model_has_roles
(model_id
,model_type
,role_id
,team_id
) values (1, App\Models\User, 1, ?))The text was updated successfully, but these errors were encountered: