<?php
namespace App\Models\Admin;
use App\Constants\AdminRoleConst;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AdminRole extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $appends = [
'editData',
];
public function getEditDataAttribute() {
$data = [
'id' => $this->id,
'name' => $this->name,
];
return json_encode($data);
}
public function scopeActive($query) {
return $query->where("status",true);
}
public function scopeNotSuperAdmin($query) {
$query->whereNot("name",AdminRoleConst::SUPER_ADMIN);
}
public function createdBy() {
return $this->belongsTo(Admin::class);
}
public function assignRole() {
return $this->hasMany(AdminHasRole::class);
}
}
If you encounter any issues or need assistance, please reach out to our dedicated developer support team Contact Us
Thank you for choosing Kueue Pay Payment Gateway Solutions! We look forward to seeing your integration thrive and provide a seamless payment experience for your valued customers.