35 lines
706 B
PHP
35 lines
706 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';
|
|
|
|
/**
|
|
* Branch
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Branch, $this>
|
|
*/
|
|
public function branch(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Branch::class);
|
|
}
|
|
|
|
/**
|
|
* User
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
|
*/
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|