Add new version in repository
This commit is contained in:
33
app/Models/Core/Auth/UserClient.php
Normal file
33
app/Models/Core/Auth/UserClient.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core\Auth;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class UserClient extends Model
|
||||
{
|
||||
protected $connection = 'system';
|
||||
protected $guarded = [];
|
||||
public $timestamps = false;
|
||||
|
||||
public function client()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Partner\Client');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
}
|
||||
|
||||
public function scopeByClient($query, $id)
|
||||
{
|
||||
return $query->where('client_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByUser($query, $id)
|
||||
{
|
||||
return $query->where('user_id', $id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user