Gunnolfson
Table page without Eloquent Model
Hi, I read this page: https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component#adding-the-table
I try to implement a page where it lists some resources, but that are not Eloquent Models. It can be for example files for my backups in order to allow an admin to download it, records on external API etc.
I know there is the Sushi package that allows to create eloquent models not related to DB but I don't like it so much.
Is there a way to manually fetch rows and still use the abstraction of the table builder or do we have to manually write the blade file with
<x-filament-tables::table>
components?7 replies
Change resource ID for FileUpload form field
Hi
I did some few things to have a ULID encoded as
binary(16)
(needed as the Backoffice would be made from Laravel Filament, because that's the best option I know, but the project isn't a Laravel project, and that's why it is not a char(26)
as Laravel handle by default)
Thing is I thus need to change things like user provider, resolve router binding etc to use a decoder on the ulid value (the value stored in DB is a binary value, the one managed by Laravel is a string, thanks to casting).
Here's what it looks like
However, when I come on an edit page for resource with a FileUpload field, I get a popup window with 404 😐 Is there anything I can do to debug it and fix it?9 replies
Relation manager with intermediate relationship
Hi
Let's say I've an entity
Foo
that has many Bar
, where Bar
belongs to many Baz
. Is that possible to have a relation manager for Foo
listing the related Baz
? 🤔
As far as I know, relation managers are based on Laravel Eloquent's relationships, and this isn't a base relationship. I cleary see how to retrieve these records using SQL joins, but not how to make it works with the awesome relation manager feature.
Thanks 🙏17 replies
Cannot delete test
Hi
I wonder what's the easiest and most maintenable way of checking something cannot be deleted from a testing point of view. I mean, testing it is not possible from "bulking action", "table action", "page action" etc requires, imo, too much test code.
I would rather look for something unique, that would look like this:
I've been adviced to use a Laravel policy to implement it. Fair enough but it is not what's relevant here. For some reasons we might not want to use a policy, and the test should be as abstract as possible from the implementations. What I mean is I don't want to have a test on a policy, but rather a "Filament test" that is more close to the feature spec than the code itself
Thanks 🙏 if you have any information about this. Moved to a help post as it's not as simple as I though initially 😅
5 replies
Enable Minio S3 in Laravel Sail environment
Hi
I'm making a CRUD resource for users, and it should be possible to add an avatar. However, I'm using a Laravel Sail environment with a minio container, acting as a s3 actor.
I'm struggling to make Livewire FileUpload component working with this setup 😅
I got this article recommended https://talltips.novate.co.uk/livewire/livewire-file-uploads-using-s3 but it seems cors is enabled by default in minio according to https://min.io/docs/minio/linux/operations/checklists/thresholds.html#id3 this
Any idea how to configure it? 🤔
3 replies
Unable to detect application namespace.
Hi
I'm working on a new project. We set up an architecture based on the Laravel Beyond Crud ebook written by Spatie. We then splitted our code into Application and Domain folders. To do this, we edited the autoload section and the bootstrap.php file:
I also changed some configuration inside
filament.php
to point out the new folders:
The test suite works well and the other pages are also working. Seems only Filament got the issue 🤔
Any idea how to debug this?3 replies