Роли, переделывание отчета, изменение на главной странице
This commit is contained in:
30
app/Models/UserRole.php
Normal file
30
app/Models/UserRole.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class UserRole extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $primaryKey = 'user_role_id';
|
||||
|
||||
protected $fillable = [
|
||||
'rf_user_id',
|
||||
'rf_role_id',
|
||||
'is_active',
|
||||
'is_default',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'rf_user_id', 'id');
|
||||
}
|
||||
|
||||
public function role(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Role::class, 'rf_role_id', 'role_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user