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 Illuminate\Tests\Integration\Http\Fixtures; class PostResourceWithOption..

Decoded Output download

<?php

namespace Illuminate\Tests\Integration\Http\Fixtures;

class PostResourceWithOptionalPivotRelationship extends PostResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'subscription' => $this->whenPivotLoaded(Subscription::class, function () {
                return [
                    'foo' => 'bar',
                ];
            }),
            'custom_subscription' => $this->whenPivotLoadedAs('accessor', Subscription::class, function () {
                return [
                    'foo' => 'bar',
                ];
            }),
        ];
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Illuminate\Tests\Integration\Http\Fixtures;

class PostResourceWithOptionalPivotRelationship extends PostResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'subscription' => $this->whenPivotLoaded(Subscription::class, function () {
                return [
                    'foo' => 'bar',
                ];
            }),
            'custom_subscription' => $this->whenPivotLoadedAs('accessor', Subscription::class, function () {
                return [
                    'foo' => 'bar',
                ];
            }),
        ];
    }
}

Function Calls

None

Variables

None

Stats

MD5 d251d4ee4a35eb3ade1ee839e35bd26e
Eval Count 0
Decode Time 110 ms