Custom Summary Page

I've got an app that uses tenancy, what would be the best way to create a summary page that has a small summary table for each tenant? I'm guessing a custom page, but I'm finding the documentation a little sparse for my beginner brain. Can anyone point me?
4 Replies
DanielvdSpoel
DanielvdSpoel2mo ago
like a central summery table or for each tenant a different one?
Hightower
Hightower2mo ago
Like a dashboard with a summary table for each I’m thinking a custom page with a widget for each tenant Iterate through each tenant and duplicate the widget
DanielvdSpoel
DanielvdSpoel2mo ago
yeah that sounds like it would work
Hightower
Hightower2mo ago
Just need to figure out how best to handle the query etc but I’ll have a bit play Am I thinking about this the right way: 1. Create a custom page, pass through the list of tenants 2. In the custom page, iterate through the tenants and pull in a widget for each 3. In the widget, call it so it knows which tenant it is looking for How do I tell my widget to stop checking for tenancy? I've tried $isScopedToTenant = false; as I would normally do with a resource I've sussed it just by accessing the model directly
public function table(Table $table): Table
{
return $table
->query(function() {
$query = Condition::where('academy_id', $this->tenant)->get();

if ($query->count() !== 0) {
return $query->toQuery();
}
}
)
->heading(Academy::find($this->tenant)->name)
->columns([
TextColumn::make('reference'),

]);
}
public function table(Table $table): Table
{
return $table
->query(function() {
$query = Condition::where('academy_id', $this->tenant)->get();

if ($query->count() !== 0) {
return $query->toQuery();
}
}
)
->heading(Academy::find($this->tenant)->name)
->columns([
TextColumn::make('reference'),

]);
}
May not be the most elegant, will gladly take suggestions how to improve
Want results from more Discord servers?
Add your server