Clay Bitner
Clay Bitner
FFilament
Created by Clay Bitner on 5/22/2024 in #❓┊help
Vapor and RDS are super slow
On my local machine, I'm getting sub 1s times, but when I push the same code to Laravel Vapor, It's taking 3-5 seconds per request. Even the simple user query takes over 600ms:
select
*
from
`users`
where
`id` = 2
and `users`.`deleted_at` is null
limit
1;
select
*
from
`users`
where
`id` = 2
and `users`.`deleted_at` is null
limit
1;
When I run the query straight from my Sequel Ace app connected to the same RDS instance, it only takes 10ms. Why is Filament 10x-ing the time?
2 replies
FFilament
Created by Clay Bitner on 4/26/2024 in #❓┊help
View not found
Has anyone come across the issue where you're experiencing the error View [name-of-view] not found on Vapor when it works fine on your local machine? We're using Vapor/AWS to host our site. We imported the package: "njxqlus/filament-relation-manager-component" which seems to work great on our local dev environment, but then when we deploy it to vapor, even if we publish the views, we're getting these errors:
"exception":
{
"class":
"Illuminate\View\ViewException",
"message":
"View [infolists.relation-manager] not found. (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php)",
"code":
0,
"file":
"/var/task/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137"
"exception":
{
"class":
"Illuminate\View\ViewException",
"message":
"View [infolists.relation-manager] not found. (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php) (View: /var/task/vendor/filament/infolists/resources/views/component-container.blade.php)",
"code":
0,
"file":
"/var/task/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137"
Am I forgetting something that needs to be modified or published somewhere?
4 replies
FFilament
Created by Clay Bitner on 1/17/2024 in #❓┊help
Adding a search to Tenant Menu
I'm trying to add a search to the Tenant menu for when the list of tenants is too long that it takes over the whole screen height. But I can't figure out how to add it or modify the menu. I tried creating a blade file with the name tenant-menu.blade.php and placing it in the resources/views/filament/components folder, but it doesn't seem to be reading that file to overwrite the original. What am I missing? Should I build a plugin for that instead?
5 replies
FFilament
Created by Clay Bitner on 12/4/2023 in #❓┊help
Does Spatie Media Library work with Vapor over 4.5mb?
According to https://docs.vapor.build/resources/storage.html in order to upload files greater than 4.5MB, you need to send files first to s3 directly. I can't figure out if the Spatie Media Library plugin will do this automatically, of I'll have to make a bunch of modifications.
21 replies
FFilament
Created by Clay Bitner on 11/20/2023 in #❓┊help
File Upload without loading existing files
I have a model with files (images) associated with it. I want to use the SpatieMediaLibraryFileUpload component to upload files to my model but in edit mode I don't want to display all the existing associated images (since there could be hundreds) in the edit form. But I want to be able to add images through that form. Is there a way I can have the uploader not load the existing associated images in the form field so I can manage the order/deletion of the existing images on a separate page?
2 replies
FFilament
Created by Clay Bitner on 10/20/2023 in #❓┊help
Getting Tenant details into custom navigation
I'm trying to add a custom navigation item to add a link to what is set as the tenant's Base Channel. But I can't seem to get access to the Filament::getTenant() function when adding the NavigationItems.
->navigationItems([
NavigationItem::make('Edit Main Channel')
->url(fn (): string => ChannelResource::getUrl('edit', [$record=Filament::getTenant()->baseChannel()]))
->sort(2)
])
->navigationItems([
NavigationItem::make('Edit Main Channel')
->url(fn (): string => ChannelResource::getUrl('edit', [$record=Filament::getTenant()->baseChannel()]))
->sort(2)
])
I get the error that Filament:getTenant() returns null. But once inside a separate page, it works properly.
1 replies
FFilament
Created by Clay Bitner on 10/2/2023 in #❓┊help
Using Spatie's Laravel-permission, is there a way to assign roles to a pivot table?
For example, if I have a User that is associated with a Tenant, but also Groups within Tenants, can I assign a role so that it gets saved in the model_has_roles table so that it has something like:
role_id = 549839
model_type = App\Models\Tenant_User
model_id = 53093

role_id = 549840
model_type = App\Models\Group_User
model_id = 83553
role_id = 549839
model_type = App\Models\Tenant_User
model_id = 53093

role_id = 549840
model_type = App\Models\Group_User
model_id = 83553
It continuously wants to just associate the role with the User model, and not based specifically on the specific relationship. And how would I try to define that relationship in the Resource?
5 replies
FFilament
Created by Clay Bitner on 8/23/2023 in #❓┊help
RelationsManager Table View/Edit actions
I have this model called Group that has a recursive parent/child relationship based on a parent_id.
Inside the GroupRelationsManager I'm getting the associated GroupResource which shows all its children, however I'm trying to figure out how to change the links for the view and edit actions on the relations table. When I show the children of the relationship I'd like to be able to click Edit and go straight into the main editing of that specific Group rather than having it pop up in a modal, so that I can do a quick dive to either add more children/grandchildren or traverse the tree. How can I modify whether the link will popup in a modal or if it is the default edit/view link that is in the main table for that resource, specially since I'm just inheriting the table resource from the parent:
public function table(Table $table): Table
{
return GroupResource::table($table)
->headerActions([
Tables\Actions\CreateAction::make()
]);
}
public function table(Table $table): Table
{
return GroupResource::table($table)
->headerActions([
Tables\Actions\CreateAction::make()
]);
}
4 replies