F
Filament2mo ago
adnn

Baptiste job monitor multi tenancy?

How can I make this plugin work properly with tenants? It keeps saying
The model [Croustibat\FilamentJobsMonitor\Models\QueueMonitor] does not have a relationship named [team]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource] resource class.
The model [Croustibat\FilamentJobsMonitor\Models\QueueMonitor] does not have a relationship named [team]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource] resource class.
Usually I'd just add
protected static bool $isScopedToTenant = false;
protected static bool $isScopedToTenant = false;
to the Resource, but this one doesn't have a resource published so I'm not really sure where or how to do it https://filamentphp.com/plugins/croustibat-jobs-monitor
Filament
Jobs monitor by Baptiste Bouillot - Filament
Monitor your queues from a panel
5 Replies
awcodes
awcodes2mo ago
You’ll need to extend the resource with your own resource and tell it to use your resource in the plugins config.
adnn
adnn2mo ago
Thank you, I really appreciate you helping everyone. I've tried doing that like so, but still getting the same error
<?php

namespace App\Filament\Resources;


use Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource;


class MyQueueMonitorResource extends QueueMonitorResource
{
protected static bool $isScopedToTenant = false;

}
<?php

namespace App\Filament\Resources;


use Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource;


class MyQueueMonitorResource extends QueueMonitorResource
{
protected static bool $isScopedToTenant = false;

}
and
<?php

return [
'resources' => [
'enabled' => true,
'label' => 'Job',
'plural_label' => 'Jobs',
'navigation_group' => 'Settings',
'navigation_icon' => 'heroicon-o-cpu-chip',
'navigation_sort' => null,
'navigation_count_badge' => false,
'resource' =>
App\Filament\Resources\MyQueueMonitorResource::class,
'cluster' => null,
],
'pruning' => [
'enabled' => true,
'retention_days' => 7,
],
];
<?php

return [
'resources' => [
'enabled' => true,
'label' => 'Job',
'plural_label' => 'Jobs',
'navigation_group' => 'Settings',
'navigation_icon' => 'heroicon-o-cpu-chip',
'navigation_sort' => null,
'navigation_count_badge' => false,
'resource' =>
App\Filament\Resources\MyQueueMonitorResource::class,
'cluster' => null,
],
'pruning' => [
'enabled' => true,
'retention_days' => 7,
],
];
awcodes
awcodes2mo ago
Sorry, I've never used the plugin, that was just my guess based on their code. Might be better to reach out to the dev either in #croustibat-jobs-monitor on on their GitHub.
adnn
adnn2mo ago
I added protected static bool $isScopedToTenant = false; to the Resource in the vendor folder directly just to see, and it fixed it, so it seems like just my resource extends is wrong, any ideas about that? I'm not OOP knowledgable
awcodes
awcodes2mo ago
your extends looks fine try moving it out of App\Filament\Resources so that it isn't auto discovered by Filament
Want results from more Discord servers?
Add your server
More Posts
insert value from function when createhello i want to insert new invoice_number from function when create the form. I try using ```formatChange column value from row actionHello, is it possible to change column values ​​from row actions? I want to change the value in the add to cart functionHi im new in filament. I wonder if theres a function for add to cart i want to integrate that to my Refreshing ParentResource Infolist when adding records in RelationManager table**What I want to do** When I add a new record on a table that is added via relation manager. I want align inputHi, I have a small problem: I would like to align the inputs with each other despite the return to I have to submit the form twice to update the table in a custom page with a table and a fromSo, I'm building a very complicated wizard that I need to use Filament Forms and Table separately inis it possible to make maxvalue in texinput dependant based on select?i want to achieve that max value from text input can change depend on how many qty left in stock frois it possible to group select items from query databaseis it possible to group select from this ```php Select::make('status') ->searchable() ->optiHow do you delete a PDF file from storage after the Edit.(only changing the FileUpload)I am able to replace a pdf file on edit but the previous one does not get removed from Storage. How wizard with many stepsHi, Do you have a solution when you have too many steps in a Wizard ? it exceeds because I have to