Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a Team is created either from the web interface of Jetstream or through a REST API call directly, it is required sometimes to execute some initialisation code. For example, populate a units_of_measure table with default values for the new Team.
What I found working is to add a boot() function inside the Team.php class and execute initialization code there when a Team is created, but is this the correct way to do it?
class Team extends JetstreamTeam
{
} //Team.php class
How to delete a Team using an API call?
I found that inside jetstream/src/Team.php there is a purge() method that does this and it is not included in the documentation.
Roles are a very important and useful part of Teams but it is static. In most real world scenarios roles are kept in a database table with the required columns for each role permission and the end user can add roles to the table with the required permissions and attach these roles to the Teams.
What is the correct way to do this in Jetstream ? would it be a good option the modify protected function configurePermissions() inside JetstreamServiceProvider.php and instead of the static configurePermissions() implementation, configure each Jetstream::role by pulling the data from a roles table?
Overall the design of Jetstream is excellent and it should not be polluted with every small possible requirement, but only with what most people use in real world applications. There is no need to hurry at the moment. We should start using it in our projects and improve it based on actually requirements.