Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace App\Livewire\Project\Application\Preview; use App\Models\Application; us..

Decoded Output download

<?php

namespace App\Livewire\Project\Application\Preview;

use App\Models\Application;
use Illuminate\Support\Str;
use Livewire\Component;
use Spatie\Url\Url;

class Form extends Component
{
    public Application $application;

    public string $preview_url_template;

    protected $rules = [
        'application.preview_url_template' => 'required',
    ];

    protected $validationAttributes = [
        'application.preview_url_template' => 'preview url template',
    ];

    public function resetToDefault()
    {
        $this->application->preview_url_template = '{{pr_id}}.{{domain}}';
        $this->preview_url_template = $this->application->preview_url_template;
        $this->application->save();
        $this->generate_real_url();
    }

    public function generate_real_url()
    {
        if (data_get($this->application, 'fqdn')) {
            $firstFqdn = Str::of($this->application->fqdn)->before(',');
            $url = Url::fromString($firstFqdn);
            $host = $url->getHost();
            $this->preview_url_template = Str::of($this->application->preview_url_template)->replace('{{domain}}', $host);
        }
    }

    public function mount()
    {
        $this->generate_real_url();
    }

    public function submit()
    {
        $this->validate();
        $this->application->preview_url_template = str_replace(' ', '', $this->application->preview_url_template);
        $this->application->save();
        $this->dispatch('success', 'Preview url template updated.');
        $this->generate_real_url();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Livewire\Project\Application\Preview;

use App\Models\Application;
use Illuminate\Support\Str;
use Livewire\Component;
use Spatie\Url\Url;

class Form extends Component
{
    public Application $application;

    public string $preview_url_template;

    protected $rules = [
        'application.preview_url_template' => 'required',
    ];

    protected $validationAttributes = [
        'application.preview_url_template' => 'preview url template',
    ];

    public function resetToDefault()
    {
        $this->application->preview_url_template = '{{pr_id}}.{{domain}}';
        $this->preview_url_template = $this->application->preview_url_template;
        $this->application->save();
        $this->generate_real_url();
    }

    public function generate_real_url()
    {
        if (data_get($this->application, 'fqdn')) {
            $firstFqdn = Str::of($this->application->fqdn)->before(',');
            $url = Url::fromString($firstFqdn);
            $host = $url->getHost();
            $this->preview_url_template = Str::of($this->application->preview_url_template)->replace('{{domain}}', $host);
        }
    }

    public function mount()
    {
        $this->generate_real_url();
    }

    public function submit()
    {
        $this->validate();
        $this->application->preview_url_template = str_replace(' ', '', $this->application->preview_url_template);
        $this->application->save();
        $this->dispatch('success', 'Preview url template updated.');
        $this->generate_real_url();
    }
}

Function Calls

None

Variables

None

Stats

MD5 812bb8ea8b573921dc5e7425164839c2
Eval Count 0
Decode Time 144 ms