⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.138
Server IP:
186.226.58.36
Server:
Linux da02.sh15.net 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Server Software:
Apache/2
PHP Version:
8.1.32
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
redesystem
/
public_html
/
sys
/
app
/
Models
/
View File Name :
Country.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasMany; /** * App\Models\Country * * @property int $id * @property string $name * @property string|null $short_code * @property int|null $phone_code * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\State[] $states * @property-read int|null $states_count * * @method static \Database\Factories\CountryFactory factory(...$parameters) * @method static \Illuminate\Database\Eloquent\Builder|Country newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Country newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Country query() * @method static \Illuminate\Database\Eloquent\Builder|Country whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|Country wherePhoneCode($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereShortCode($value) * @method static \Illuminate\Database\Eloquent\Builder|Country whereUpdatedAt($value) * * @mixin \Eloquent */ class Country extends Model { use HasFactory; public $table = 'countries'; public $fillable = [ 'name', 'short_code', 'phone_code', ]; /** * The attributes that should be casted to native types. * * @var array */ protected $casts = [ 'name' => 'string', 'short_code' => 'string', 'phone_code' => 'integer', ]; /** * Validation rules * * @var array */ public static $rules = [ 'name' => 'required|string|max:170|unique:countries,name', 'short_code' => 'nullable|string|max:170|unique:countries,short_code', 'phone_code' => 'nullable|integer', ]; public function states(): HasMany { return $this->hasMany(State::class, 'country_id'); } }