1234567891011121314151617181920212223242526 |
- <?php
- namespace Knuckles\Scribe\Tests\Fixtures;
- use Illuminate\Http\Resources\Json\JsonResource;
- class TestUserApiResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- *
- * @return array
- */
- public function toArray($request)
- {
- return [
- 'id' => $this->id,
- 'name' => $this->first_name . ' ' . $this->last_name,
- 'email' => $this->email,
- 'state1' => $this['state1'],
- 'random-state' => $this['random-state'],
- ];
- }
- }
|