public function includeClient(Project $project) { $client = $project->client()->find($project->client_id); return $this->item($client, new ClientTransformer()); }
public function transform(Project $project) { return ['id' => $project->id, 'project' => $project->name, 'description' => $project->description, 'progress' => $project->progress, 'status' => $project->status, 'due_date' => $project->due_date, 'client' => $project->client()->first()->name]; }
public function includeClient(Project $project) { return $this->collection($project->client()->get(), new ProjectClientTransformer()); }