This commit is contained in:
2026-04-06 18:44:02 +05:00
commit d775fbb9ba
431 changed files with 31234 additions and 0 deletions

28
app/Models/Permission.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Permission extends Model
{
public $timestamps = false;
protected $fillable = [
'name',
'slug',
'group',
'description',
];
public function roles(): BelongsToMany
{
return $this->belongsToMany(Role::class)->withTimestamps();
}
public function scopeInGroup($query, string $group)
{
$query->where('group', $group);
}
}