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 Filament\Tables\Filters; use Illuminate\Database\Eloquent\Builder; use I..

Decoded Output download

<?php

namespace Filament\Tables\Filters;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class TrashedFilter extends TernaryFilter
{
    public static function getDefaultName(): ?string
    {
        return 'trashed';
    }

    protected function setUp(): void
    {
        parent::setUp();

        $this->label(__('filament-tables::table.filters.trashed.label'));

        $this->placeholder(__('filament-tables::table.filters.trashed.without_trashed'));

        $this->trueLabel(__('filament-tables::table.filters.trashed.with_trashed'));

        $this->falseLabel(__('filament-tables::table.filters.trashed.only_trashed'));

        $this->queries(
            true: fn ($query) => $query->withTrashed(),
            false: fn ($query) => $query->onlyTrashed(),
            blank: fn ($query) => $query->withoutTrashed(),
        );

        $this->baseQuery(fn (Builder $query) => $query->withoutGlobalScopes([
            SoftDeletingScope::class,
        ]));

        $this->indicateUsing(function (array $state): array {
            if ($state['value'] ?? null) {
                return [Indicator::make($this->getTrueLabel())];
            }

            if (blank($state['value'] ?? null)) {
                return [];
            }

            return [Indicator::make($this->getFalseLabel())];
        });
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Filament\Tables\Filters;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class TrashedFilter extends TernaryFilter
{
    public static function getDefaultName(): ?string
    {
        return 'trashed';
    }

    protected function setUp(): void
    {
        parent::setUp();

        $this->label(__('filament-tables::table.filters.trashed.label'));

        $this->placeholder(__('filament-tables::table.filters.trashed.without_trashed'));

        $this->trueLabel(__('filament-tables::table.filters.trashed.with_trashed'));

        $this->falseLabel(__('filament-tables::table.filters.trashed.only_trashed'));

        $this->queries(
            true: fn ($query) => $query->withTrashed(),
            false: fn ($query) => $query->onlyTrashed(),
            blank: fn ($query) => $query->withoutTrashed(),
        );

        $this->baseQuery(fn (Builder $query) => $query->withoutGlobalScopes([
            SoftDeletingScope::class,
        ]));

        $this->indicateUsing(function (array $state): array {
            if ($state['value'] ?? null) {
                return [Indicator::make($this->getTrueLabel())];
            }

            if (blank($state['value'] ?? null)) {
                return [];
            }

            return [Indicator::make($this->getFalseLabel())];
        });
    }
}

Function Calls

None

Variables

None

Stats

MD5 6bccb4392f47bb117f3deec6bb60aaae
Eval Count 0
Decode Time 118 ms