Spark - Eloquent Relationships for Teams

Posted 5 months ago by oliverbusk

Hi all

I am currently trying to create a simple SaaS application, where teams can create projects. I am currently stuck at the migration, because I am unsure if the user or the team should "own" the project?

For example, I would normally do this:

User.php:

public function projects()
{
     return $this->hasMany('App\Projects');
}

Project.php:

public function user()
{
     return $this->belongsTo('App\User');
}

So in above case, the user can have many projects and a project belongs to an user.

How should I do this in Laravel Spark with teams?

Please sign in or create an account to participate in this conversation.