<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class BlockResource extends JsonResource
{
    public function toArray($request)
    {
        $out = [
            'id'           => (int)$this->id,
            'type'         => $this->type,
        ];

        // Specific block data per type
        $out = array_merge($out, $this->_getBlockData());

        return $out;
    }
}
