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; use App\Models\Application; use App\Mo..

Decoded Output download

<?php

namespace App\Livewire\Project\Application;

use App\Models\Application;
use App\Models\PrivateKey;
use Livewire\Component;

class Source extends Component
{
    public $applicationId;

    public Application $application;

    public $private_keys;

    protected $rules = [
        'application.git_repository' => 'required',
        'application.git_branch' => 'required',
        'application.git_commit_sha' => 'nullable',
    ];

    protected $validationAttributes = [
        'application.git_repository' => 'repository',
        'application.git_branch' => 'branch',
        'application.git_commit_sha' => 'commit sha',
    ];

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

    private function get_private_keys()
    {
        $this->private_keys = PrivateKey::whereTeamId(currentTeam()->id)->get()->reject(function ($key) {
            return $key->id == $this->application->private_key_id;
        });
    }

    public function setPrivateKey(int $private_key_id)
    {
        $this->application->private_key_id = $private_key_id;
        $this->application->save();
        $this->application->refresh();
        $this->get_private_keys();
    }

    public function submit()
    {
        $this->validate();
        if (! $this->application->git_commit_sha) {
            $this->application->git_commit_sha = 'HEAD';
        }
        $this->application->save();
        $this->dispatch('success', 'Application source updated!');
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Livewire\Project\Application;

use App\Models\Application;
use App\Models\PrivateKey;
use Livewire\Component;

class Source extends Component
{
    public $applicationId;

    public Application $application;

    public $private_keys;

    protected $rules = [
        'application.git_repository' => 'required',
        'application.git_branch' => 'required',
        'application.git_commit_sha' => 'nullable',
    ];

    protected $validationAttributes = [
        'application.git_repository' => 'repository',
        'application.git_branch' => 'branch',
        'application.git_commit_sha' => 'commit sha',
    ];

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

    private function get_private_keys()
    {
        $this->private_keys = PrivateKey::whereTeamId(currentTeam()->id)->get()->reject(function ($key) {
            return $key->id == $this->application->private_key_id;
        });
    }

    public function setPrivateKey(int $private_key_id)
    {
        $this->application->private_key_id = $private_key_id;
        $this->application->save();
        $this->application->refresh();
        $this->get_private_keys();
    }

    public function submit()
    {
        $this->validate();
        if (! $this->application->git_commit_sha) {
            $this->application->git_commit_sha = 'HEAD';
        }
        $this->application->save();
        $this->dispatch('success', 'Application source updated!');
    }
}

Function Calls

None

Variables

None

Stats

MD5 0f35177321f78581fc6108c561213f6e
Eval Count 0
Decode Time 118 ms