My query is not properly working; this query only gets data from one table. However, I should be able to take data from both tables. I'm using the pluck()
method.
$this->projectcosts = ProjectCost::where('project_id', $id)
->get()->pluck('costItems')->toArray();