⚝
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 :
Package.php
<?php namespace App\Models; use App\Traits\PopulateTenantID; use Eloquent as Model; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Carbon; use Stancl\Tenancy\Database\Concerns\BelongsToTenant; /** * Class Package * * @version February 25, 2020, 1:10 pm UTC * * @property int $id * @property string $name * @property string $description * @property float $discount * @property float $total_amount * @property Carbon|null $created_at * @property Carbon|null $updated_at * * @method static Builder|Package newModelQuery() * @method static Builder|Package newQuery() * @method static Builder|Package query() * @method static Builder|Package whereCreatedAt($value) * @method static Builder|Package whereDescription($value) * @method static Builder|Package whereDiscount($value) * @method static Builder|Package whereId($value) * @method static Builder|Package whereName($value) * @method static Builder|Package whereTotalAmount($value) * @method static Builder|Package whereUpdatedAt($value) * * @mixin Model * * @property-read Collection|PackageService[] $packageServicesItems * @property-read int|null $package_services_items_count * @property int $is_default * * @method static Builder|Package whereIsDefault($value) */ class Package extends Model { use BelongsToTenant, PopulateTenantID; /** * Validation rules * * @var array */ public static $rules = [ 'name' => 'required|is_unique:packages,name', 'discount' => 'required', 'total_amount' => 'required', ]; public $table = 'packages'; public $fillable = [ 'name', 'description', 'discount', 'total_amount', ]; /** * Get the attributes that should be cast. * * @return array<string, string> */ protected function casts(): array { return [ 'id' => 'integer', 'name' => 'string', 'description' => 'string', 'discount' => 'double', 'total_amount' => 'double', ]; } public function packageServicesItems(): HasMany { return $this->hasMany(PackageService::class); } }