fix: complete admins permission

This commit is contained in:
2026-08-19 12:42:22 -07:00
parent bbd588c361
commit c100f1b70a
4 changed files with 141 additions and 4 deletions
+89
View File
@@ -0,0 +1,89 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class AdminPermission
*
* @property int $id
* @property int $admin_id
* @property bool $flight_create
* @property bool $flight_edit
* @property bool $flight_delete
* @property bool $tour_create
* @property bool $tour_edit
* @property bool $tour_delete
* @property bool $booking_view
* @property bool $booking_edit
* @property bool $booking_delete
* @property bool $user_view
* @property bool $user_edit
* @property bool $user_delete
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property bool $admin_view
* @property bool $admin_create
* @property bool $admin_edit
* @property bool $admin_delete
*
* @property Admin $admin
*
* @package App\Models
*/
class AdminPermission extends Model
{
protected $table = 'admin_permissions';
public static $snakeAttributes = false;
protected $casts = [
'admin_id' => 'int',
'flight_create' => 'bool',
'flight_edit' => 'bool',
'flight_delete' => 'bool',
'tour_create' => 'bool',
'tour_edit' => 'bool',
'tour_delete' => 'bool',
'booking_view' => 'bool',
'booking_edit' => 'bool',
'booking_delete' => 'bool',
'user_view' => 'bool',
'user_edit' => 'bool',
'user_delete' => 'bool',
'admin_view' => 'bool',
'admin_create' => 'bool',
'admin_edit' => 'bool',
'admin_delete' => 'bool'
];
protected $fillable = [
'admin_id',
'flight_create',
'flight_edit',
'flight_delete',
'tour_create',
'tour_edit',
'tour_delete',
'booking_view',
'booking_edit',
'booking_delete',
'user_view',
'user_edit',
'user_delete',
'admin_view',
'admin_create',
'admin_edit',
'admin_delete'
];
public function admin()
{
return $this->belongsTo(Admin::class);
}
}