My Spark installation should not require users to register a team. Our application is built on the idea that everyone should have a team, but a few features is available without.
Is there a way to allow users to register without teams? I've tried changing the views, but the whole authentication driver behind spark still requires the team field, and I'm not quite sure how much I "may" change in the spark folder without saying goodbye to every upcoming update.
I'd also be very interested to get this answered without breaking future updates...
Here is what I found so far:
the concept of a team is entirely optional in spark (users can delete a team after the initial cration and everyhting will work normally) - only the validation during registration breaks it
unfortunately 'required' is hardcoded in validation during registraion in vendor\laravel\spark\src\Interactions\Auth\CreateUser.php
as follows:
public function validator($request)
{
$validator = $this->baseValidator($request);
$validator->sometimes('team', 'required|max:255', function ($input) {
return Spark::usesTeams() && ! isset($input['invitation']);
});
return $validator;
If you remove the 'required' you are done, but this might break any future updates - which is exactly the tricky point...
EDIT:
there is also a middleware reminding/ redirecting people to create a team if they have none, but it can be disabled easily.
Remove the input field in the common registration template. Now you need to remove the hasTeam middleware from your own RouteServiceProvider to prevent the missing-team redirect after registering.
I also have my own user creator/validator classes swapped so I'm not sure if you'll need to do that or not to remove any teamname required validation.
If anyone happens to come across this because they are seeing the missing-team view and url, this is because there is the hasTeam middleware being passed in your RouteServiceProvider. You can just remove that from the middleware array for the group: