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 Webkul\Admin\Exports; use Illuminate\Support\Arr; use Maatwebsite\Excel\..

Decoded Output download

<?php

namespace Webkul\Admin\Exports;

use Illuminate\Support\Arr;
use Maatwebsite\Excel\Concerns\FromCollection;

class ReportingExport implements FromCollection
{
    /**
     * Create a new instance.
     *
     * @param mixed records
     * @return void
     */
    public function __construct(protected $records = [])
    {
    }

    /**
     * function to create a blade view for export.
     *
     * @return Collection
     */
    public function collection()
    {
        $rows[] = Arr::pluck($this->records['columns'], 'label');

        foreach ($this->records['records'] as $key => $record) {
            $data = [];

            foreach ($this->records['columns'] as $column) {
                $data[$column['label']] = $record[$column['key']];
            }

            $rows[] = (object) $data;
        }

        return collect($rows);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Webkul\Admin\Exports;

use Illuminate\Support\Arr;
use Maatwebsite\Excel\Concerns\FromCollection;

class ReportingExport implements FromCollection
{
    /**
     * Create a new instance.
     *
     * @param mixed records
     * @return void
     */
    public function __construct(protected $records = [])
    {
    }

    /**
     * function to create a blade view for export.
     *
     * @return Collection
     */
    public function collection()
    {
        $rows[] = Arr::pluck($this->records['columns'], 'label');

        foreach ($this->records['records'] as $key => $record) {
            $data = [];

            foreach ($this->records['columns'] as $column) {
                $data[$column['label']] = $record[$column['key']];
            }

            $rows[] = (object) $data;
        }

        return collect($rows);
    }
}

Function Calls

None

Variables

None

Stats

MD5 393e5f721896e47ed90adb0994b8288b
Eval Count 0
Decode Time 124 ms