Files
opensem/app/Models/Core/Auth/UserClient.php
Ludovic CANDELLIER 39c80ce6d1 add shipping rules
2023-07-16 14:45:42 +02:00

35 lines
625 B
PHP

<?php
namespace App\Models\Core\Auth;
use Illuminate\Database\Eloquent\Model;
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);
}
}