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\Traits; use Illuminate\Support\Str; trait Trackers { public sta..

Decoded Output download

<?php

namespace App\Traits;

use Illuminate\Support\Str;

trait Trackers
{
    public static function getTrackerTags(): array
    {
        return [
            'company_id' => (string) company_id(),
            'locale' => (string) app()->getLocale(),
            'timezone' => (string) config('app.timezone'),
            'app_type' => (string) static::getAppType(),
            'route_name' => (string) static::getRouteName(),
        ];
    }

    public static function getAppType(): string
    {
        $hostname = gethostname();

        if (Str::contains($hostname, '-queue-')) {
            $app_type = 'queue';
        } elseif (Str::contains($hostname, '-cron-')) {
            $app_type = 'cron';
        } elseif (request_is_api()) {
            $app_type = 'api';
        } elseif (app()->runningInConsole()) {
            $app_type = 'console';
        } else {
            $app_type = 'ui';
        }

        return $app_type;
    }

    public static function getRouteName(): ?string
    {
        return request()->route()?->getName();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Traits;

use Illuminate\Support\Str;

trait Trackers
{
    public static function getTrackerTags(): array
    {
        return [
            'company_id' => (string) company_id(),
            'locale' => (string) app()->getLocale(),
            'timezone' => (string) config('app.timezone'),
            'app_type' => (string) static::getAppType(),
            'route_name' => (string) static::getRouteName(),
        ];
    }

    public static function getAppType(): string
    {
        $hostname = gethostname();

        if (Str::contains($hostname, '-queue-')) {
            $app_type = 'queue';
        } elseif (Str::contains($hostname, '-cron-')) {
            $app_type = 'cron';
        } elseif (request_is_api()) {
            $app_type = 'api';
        } elseif (app()->runningInConsole()) {
            $app_type = 'console';
        } else {
            $app_type = 'ui';
        }

        return $app_type;
    }

    public static function getRouteName(): ?string
    {
        return request()->route()?->getName();
    }
}

Function Calls

None

Variables

None

Stats

MD5 9c53428a3b99e0904a15155742d93df0
Eval Count 0
Decode Time 110 ms