!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/packages/Webkul/Admin/src/Http/Controllers/Settings/   drwxrwxrwx
Free 12.97 GB of 57.97 GB (22.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\Admin\Http\Controllers\Settings;

use 
Illuminate\Http\JsonResponse;
use 
Illuminate\Http\RedirectResponse;
use 
Illuminate\Support\Facades\Event;
use 
Illuminate\View\View;
use 
Webkul\Admin\Http\Controllers\Controller;
use 
Webkul\Attribute\Repositories\AttributeRepository;
use 
Webkul\Contact\Repositories\PersonRepository;
use 
Webkul\Lead\Repositories\LeadRepository;
use 
Webkul\Lead\Repositories\PipelineRepository;
use 
Webkul\Lead\Repositories\SourceRepository;
use 
Webkul\Lead\Repositories\TypeRepository;
use 
Webkul\WebForm\DataGrids\WebFormDataGrid;
use 
Webkul\WebForm\Repositories\WebFormRepository;

class 
WebFormController extends Controller
{
    
/**
     * Create a new controller instance.
     *
     * @return void
     */
    
public function __construct(
        protected 
AttributeRepository $attributeRepository,
        protected 
WebFormRepository $webFormRepository,
        protected 
PersonRepository $personRepository,
        protected 
LeadRepository $leadRepository,
        protected 
PipelineRepository $pipelineRepository,
        protected 
SourceRepository $sourceRepository,
        protected 
TypeRepository $typeRepository
    
) {}

    
/**
     * Display a listing of the email template.
     */
    
public function index(): View|JsonResponse
    
{
        if (
request()->ajax()) {
            return 
datagrid(WebFormDataGrid::class)->process();
        }

        return 
view('admin::settings.web-forms.index');
    }

    
/**
     * Show the form for creating a new resource.
     */
    
public function create(): View
    
{
        
$tempAttributes $this->attributeRepository->findWhereIn('entity_type', ['persons''leads']);

        
$attributes = [];

        foreach (
$tempAttributes as $attribute) {
            if (
                
$attribute->entity_type == 'persons'
                
&& in_array($attribute->code, ['name''emails''contact_numbers'])
            ) {
                
$attributes['default'][] = $attribute;
            } else {
                
$attributes['other'][] = $attribute;
            }
        }

        return 
view('admin::settings.web-forms.create'compact('attributes'));
    }

    
/**
     * Store a newly created email templates in storage.
     */
    
public function store(): RedirectResponse
    
{
        
$this->validate(request(), [
            
'title'                  => 'required',
            
'submit_button_label'    => 'required',
            
'submit_success_action'  => 'required',
            
'submit_success_content' => 'required',
        ]);

        
Event::dispatch('settings.web_forms.create.before');

        
$data request()->all();

        
$webForm $this->webFormRepository->create($data);

        
Event::dispatch('settings.web_forms.create.after'$webForm);

        
session()->flash('success'trans('admin::app.settings.webforms.index.create-success'));

        return 
redirect()->route('admin.settings.web_forms.index');
    }

    
/**
     * Show the form for editing the specified email template.
     */
    
public function edit(int $id): View
    
{
        
$webForm $this->webFormRepository->findOrFail($id);

        
$attributes $this->attributeRepository->findWhere([
            [
'entity_type''IN', ['persons''leads']],
            [
'id''NOTIN'$webForm->attributes()->pluck('attribute_id')->toArray()],
        ]);

        return 
view('admin::settings.web-forms.edit'compact('webForm''attributes'));
    }

    
/**
     * Update the specified email template in storage.
     */
    
public function update(int $id): RedirectResponse
    
{
        
$this->validate(request(), [
            
'title'                  => 'required',
            
'submit_button_label'    => 'required',
            
'submit_success_action'  => 'required',
            
'submit_success_content' => 'required',
        ]);

        
Event::dispatch('settings.web_forms.update.before'$id);

        
$data request()->all();

        
$webForm $this->webFormRepository->update($data$id);

        
Event::dispatch('settings.web_forms.update.after'$webForm);

        
session()->flash('success'trans('admin::app.settings.webforms.index.update-success'));

        return 
redirect()->route('admin.settings.web_forms.index');
    }

    
/**
     * Remove the specified email template from storage.
     */
    
public function destroy(int $id): JsonResponse
    
{
        
$webForm $this->webFormRepository->findOrFail($id);

        try {
            
Event::dispatch('settings.web_forms.delete.before'$id);

            
$webForm->delete($id);

            
Event::dispatch('settings.web_forms.delete.after'$id);

            return 
response()->json([
                
'message' => trans('admin::app.settings.webforms.index.delete-success'),
            ]);
        } catch (
\Exception $exception) {
            return 
response()->json([
                
'message' => trans('admin::app.settings.webforms.index.delete-failed'),
            ], 
400);
        }
    }
}

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