daar
Resize image in SpatieMediaLibraryFileUpload
Hello, I find Spatie's package excellent, especially for defining conversions to resize uploaded images. However, I'm wondering if there's a way to convert the original file before it gets placed on the server, thus skipping the conversions. The issue is that the original file remains publicly accessible, and I'd like to prevent that.
Regards,
Darius
10 replies
Show blade page security + integrate into filament panel
I've integrated a simple invoicing feature into my app (see the web route below). I'd love to get insights from experts on two points:
1. Is the
auth
middleware I've applied sufficient to secure this route?
2. I've been trying to link a blade view with Filament. However, using a ViewField
, seems to disrupt the layout by moving the navigation sidebar and top bar drastically. I believe this is likely due to a CSS issue. If I aim to integrate this into Filament, is there a way to separate the CSS within the blade view itself (and not interfere with the filament CSS classes), or are there tools available that can help?
1 replies
Relation Manager dependency
I've got a relation manager, and I'm looking to introduce a dependency. This would narrow down the visible records it shows to only those attachable items where the customer matches the one associated with the record I'm aiming to attach it to.
Consider this example:
The invoice requires payments to be linked, specifically those associated with the selected customer for this particular invoice.
5 replies
Creating a more ordered admin panel
Hi, I've been working on an application that extensively uses Filament for about a year or so. At first v2, but I recently switched to v3. The application uses 54 tables and in total 34 menu entries. I ordered them, but the submenus are too long for practical use. I have two options I wanted to consider for my admin resource (10 items) but I'm not sure what the most practical is:
1. make use of a second menu bar inside the pages for each resource e.g.
aymanalhattami/filament-page-with-sidebar
2. make use of tabs that per tab show the CRUD actions for the resources
Any advice would be appreciated. I am playing with the plugin mentioned in #1, but I don't know how to hide the resources from the main menu though.
TIA!6 replies
Searchable and sortable on polymorph
Hi, how to implement a search based on a polymorphic relation with a relationship one down even?
With the following code I get the error for sorting:
On searching I get: Seems like a bug in Filament? The code used is shown below:
Call to a member function getRelated() on null
.
On searching I get: Seems like a bug in Filament? The code used is shown below:
2 replies
Create pest tests
The following code gives a 404, which I don't understand why.
My URL is: http://localhost/emr/admission-prices
Any suggestions?
5 replies
Hide SelectColumn based on soft delete status
I want to hide a column, as per the title. See the code below. This has worked before within the project, but I in this case get the error:
Argument #1 ($record) must be of type App\Models\Payment, null given
. Any suggestions?
15 replies
Builder query for polymorphic relations
I would like to create a custom filter with a custom query as shown below. The query needs to follow the
payable
polymorphic relationship on the active record and on that relationship check if the consulable_type
is of a specific class.
Tables\Filters\Filter::make('consult')
->query(
function (Builder $query) {
return $query->whereHas('payable', function ($query) {
$query->where('consultable_type', '=', WardConsult::class);
});
}
),
When activating this filter, I get the error: Class "App\Models\Unknown" not found
. Does anyone know an active example or could help me fix this code?
TIA!3 replies