25 lines
476 B
PHP
25 lines
476 B
PHP
<?php
|
|
|
|
namespace App\Modules\Branch\Models;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
|
|
|
class UserBranch extends Pivot
|
|
{
|
|
public $incrementing = true;
|
|
|
|
protected $table = 'branch_user';
|
|
|
|
public function branch(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Branch::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|