!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/cloud_campaign/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/   drwxr-xr-x
Free 12.97 GB of 57.97 GB (22.37%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Illuminate\Http\Resources\Json;

use 
Illuminate\Contracts\Support\Responsable;
use 
Illuminate\Database\Eloquent\Model;
use 
Illuminate\Support\Collection;

class 
ResourceResponse implements Responsable
{
    
/**
     * The underlying resource.
     *
     * @var mixed
     */
    
public $resource;

    
/**
     * Create a new resource response.
     *
     * @param  mixed  $resource
     * @return void
     */
    
public function __construct($resource)
    {
        
$this->resource $resource;
    }

    
/**
     * Create an HTTP response that represents the object.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\JsonResponse
     */
    
public function toResponse($request)
    {
        return 
tap(response()->json(
            
$this->wrap(
                
$this->resource->resolve($request),
                
$this->resource->with($request),
                
$this->resource->additional
            
),
            
$this->calculateStatus()
        ), function (
$response) use ($request) {
            
$response->original $this->resource->resource;

            
$this->resource->withResponse($request$response);
        });
    }

    
/**
     * Wrap the given data if necessary.
     *
     * @param  array  $data
     * @param  array  $with
     * @param  array  $additional
     * @return array
     */
    
protected function wrap($data$with = [], $additional = [])
    {
        if (
$data instanceof Collection) {
            
$data $data->all();
        }

        if (
$this->haveDefaultWrapperAndDataIsUnwrapped($data)) {
            
$data = [$this->wrapper() => $data];
        } elseif (
$this->haveAdditionalInformationAndDataIsUnwrapped($data$with$additional)) {
            
$data = [($this->wrapper() ?? 'data') => $data];
        }

        return 
array_merge_recursive($data$with$additional);
    }

    
/**
     * Determine if we have a default wrapper and the given data is unwrapped.
     *
     * @param  array  $data
     * @return bool
     */
    
protected function haveDefaultWrapperAndDataIsUnwrapped($data)
    {
        return 
$this->wrapper() && ! array_key_exists($this->wrapper(), $data);
    }

    
/**
     * Determine if "with" data has been added and our data is unwrapped.
     *
     * @param  array  $data
     * @param  array  $with
     * @param  array  $additional
     * @return bool
     */
    
protected function haveAdditionalInformationAndDataIsUnwrapped($data$with$additional)
    {
        return (! empty(
$with) || ! empty($additional)) &&
               (! 
$this->wrapper() ||
                ! 
array_key_exists($this->wrapper(), $data));
    }

    
/**
     * Get the default data wrapper for the resource.
     *
     * @return string
     */
    
protected function wrapper()
    {
        return 
get_class($this->resource)::$wrap;
    }

    
/**
     * Calculate the appropriate status code for the response.
     *
     * @return int
     */
    
protected function calculateStatus()
    {
        return 
$this->resource->resource instanceof Model &&
               
$this->resource->resource->wasRecentlyCreated 201 200;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0047 ]--