[WIP] Setup of skeleton
This commit is contained in:
30
app/Models/Auth/PermissionRole.php
Normal file
30
app/Models/Auth/PermissionRole.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Auth;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PermissionRole extends Model
|
||||
{
|
||||
protected $table = 'permission_role';
|
||||
|
||||
public function permission()
|
||||
{
|
||||
return $this->belongsTo('App\Permission');
|
||||
}
|
||||
|
||||
public function role()
|
||||
{
|
||||
return $this->belongsTo('App\Role');
|
||||
}
|
||||
|
||||
public function scopeByPermission($query, $id)
|
||||
{
|
||||
return $query->where('permission_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByRole($query, $id)
|
||||
{
|
||||
return $query->where('role_id', $id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user