main

filamentphp/demo

Last updated at: 29/12/2023 09:52

Team.php

TLDR

This file defines a class called Team that extends the JsonResource class from the Illuminate\Http\Resources\Json namespace in Laravel. It overrides the toArray method to transform the resource into an array.

END

<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class Team extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        return parent::toArray($request);
    }
}