0

I have one class PlanProjectList and I have different categories which is managed from the DB.

Now, I want to display category name wise project listing in unique card.

private function getProjectCategories(): array
{
    return ProjectCategor::all()->pluck('name', 'id');
}
protected function getHeaderWidgets(): array
{
    $classes = [];

    $project_categories = $this->getProjectCategories();
    foreach ( $project_categories as $project_category ) {
        $class = new Widgets\PlanProjectList;
        $class->setHeader($project_category);
        $classes[] = $class->getClass();
    }

    return $classes;
}

Here, I am using ->setHeader() for set title, but only last category name is display.

Thanks.

Mitesh Rathod
  • 879
  • 5
  • 18

0 Answers0