Skip to content
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

Add useTeamModel and useMembershipModel to compliment useUserModel #121

Merged
merged 1 commit into from
Sep 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Jetstream.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ public static function newTeamModel()
return new $model;
}

/**
* Specify the team model that should be used by Jetstream.
*
* @param string $model
* @return static
*/
public static function useTeamModel(string $model)
{
static::$teamModel = $model;

return new static;
}

/**
* Get the name of the team model used by the application.
*
Expand All @@ -266,6 +279,19 @@ public static function membershipModel()
return static::$membershipModel;
}

/**
* Specify the membership model that should be used by Jetstream.
*
* @param string $model
* @return static
*/
public static function useMembershipModel(string $model)
{
static::$membershipModel = $model;

return new static;
}

/**
* Register a class / callback that should be used to create teams.
*
Expand Down