[WIP] Fix ergonomics rules
This commit is contained in:
31
app/Models/Core/Auth/TeamUser.php
Normal file
31
app/Models/Core/Auth/TeamUser.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\Auth;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TeamUser extends Model
|
||||
{
|
||||
protected $table = 'team_user';
|
||||
protected $connection = 'mysql';
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Core\Auth\User');
|
||||
}
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Core\Auth\Team');
|
||||
}
|
||||
|
||||
public function scopeByUser($query, $id)
|
||||
{
|
||||
return $query->where('user_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByTeam($query, $id)
|
||||
{
|
||||
return $query->where('team_id', $id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user