VoteResource.php 476 Bytes
<?php

namespace FootyRoom\Http\Vote;

use FootyRoom\Http\Resource;
use FootyRoom\Queries\Vote\Vote;

class VoteResource extends Resource
{
    public function __construct(Vote $resource = null)
    {
        $this->resource = $resource;
    }

    /**
     * @param \Illuminate\Http\Request $request
     */
    public function toArray($request): array
    {
        return [
            'value' => $this->value,
            'username' => $this->username,
        ];
    }
}