I need to create a widget to display the last records in a table within a category and reapeat that for every category matching certain criteria. The problem here is that I haven't found a way to do this without manually creating a widget for every category and manually inserting them in my dashboard. Any way to do this without having to create almost everything from scratch?
I was specting to be able to add a loop in the getWidgets function and dynamically add those with something like:
foreach ($categories as $category) {
$widgets[] = LastCreatedByCategoryId::make($category->id);
}
I don't find a way either repeat the same widget in the dashboard or to pass params to it.