Support for settings in subscription plans
As the course mentions in "Subscription Plans" with the example of limiting features for each plan how is this possible with Wave?
The video mentions in the example "1 Project Access, 1 User per Project".
Since this is exactly what I would like to build I do not see support for this in any way.
I would like to have some sort of settings that I can manage per plan. And then check these with the "can" method in blade.
Can someone assist how to modify the code?
Hi there,
You can use the User Roles to limit the access for your users from executing specific CRUD actions.
However for additional limitations, you would need to add some custom logic as well.
For example if you have a Model called Projects, you could add an if statement to check which Plan the user is assigned to and allow them to add more projets or not.
To check the current plan for a specific user you could use the following:
auth()->user()->role->name
Also if you wanted to check if a user can create projects you could use the following statement:
@if (auth()->user()->can('create', App\Project))
// can create a project
@else
// can not create a project
@endif
You could extend that if statement and check how many projects the user currently has and if they are more than the allowed don't let them create more projects.
Regards, Bobby