Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/rentpix.corals.io/vendor/spatie/laravel-ray/src/Payloads/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/rentpix.corals.io/vendor/spatie/laravel-ray/src/Payloads/ViewPayload.php
<?php

namespace Spatie\LaravelRay\Payloads;

use Illuminate\Support\Str;
use Illuminate\View\View;
use Spatie\Ray\ArgumentConverter;
use Spatie\Ray\Payloads\Payload;

class ViewPayload extends Payload
{
    /** @var \Illuminate\View\View */
    protected $view;

    public function __construct(View $view)
    {
        $this->view = $view;
    }

    public function getType(): string
    {
        return 'view';
    }

    public function getContent(): array
    {
        return [
            'view_path' => $this->view->getPath(),
            'view_path_relative_to_project_root' => Str::after($this->pathRelativeToProjectRoot($this->view), '/'),
            'data' => ArgumentConverter::convertToPrimitive($this->getData($this->view)),
        ];
    }

    protected function pathRelativeToProjectRoot(View $view): string
    {
        $path = $view->getPath();

        if (Str::startsWith($path, base_path())) {
            $path = substr($path, strlen(base_path()));
        }

        return $path;
    }

    protected function getData(View $view): array
    {
        return collect($view->getData())
            ->filter(function ($value, $key) {
                return ! in_array($key, ['app', '__env', 'obLevel', 'errors']);
            })
            ->toArray();
    }
}

Spamworldpro Mini