Looks like the answer to this problem is here:
Adding a column to the teams table
Short version - How do you extend the teams table? I've added a column to the teams table and can't seem to save data to it when I create a new team.
Long version - I've taken Spark and made it even more multi-tennant using a CNAME for my clients, who can then have teams, etc. This was necessary, I'm not just bored :)
To get this to work - I added a clients table and client_id fields to my users and teams table.
When the owner signs up, a new record is created in the clients table and thus a client_id. I can't figure out how to get it saved to the teams table.
I've tried hacking up TeamController.php (yea I know this is in the src tree and will get overwritten) Anyway right before the CreateTeam call, I add client_id to the request variable with
$request->request->add(['client_id' => Auth::user()->client_id]);
this works and can see it if I dd($request)
I also edited the model - Team.php and added 'client_id' to the $fillable
but I still get the error: Field 'client_id' does not have a default value
Which means to me that the model isn't accepting (or seeing) the client_id I have in $request.
Any ideas how to extend the Teams model? (and if there's a proper way to do this that will outlive an update).
Thanks
Please or to participate in this conversation.