37 lines
671 B
PHP
37 lines
671 B
PHP
<?php
|
|
|
|
namespace App\Models\Core\Auth;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UserStatusTeam extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $connection = 'mysql';
|
|
|
|
protected $guarded = [];
|
|
|
|
protected $table = 'user_status_teams';
|
|
|
|
public function user_status()
|
|
{
|
|
return $this->belongsTo(UserStatus::class);
|
|
}
|
|
|
|
public function team()
|
|
{
|
|
return $this->belongsTo(Team::class);
|
|
}
|
|
|
|
public function scopeByUserStatus($query, $id)
|
|
{
|
|
return $query->where('user_status_id', $id);
|
|
}
|
|
|
|
public function scopeByTeam($query, $id)
|
|
{
|
|
return $query->where('team_id', $id);
|
|
}
|
|
}
|