Relation table in a Tab?
Hi everyone, is it possible to insert the relationship table between two resources within a tab? My problem is that I have one between Customer and Activity which in turn has a relationship with Attachments
29 Replies
Something like this
The activities should only be those related to that specific customer
Then, by selecting an activity I would like to see only its attachments
Otherwise... something like that
but by clicking on a row of the Activity table I would also like to see its attachments (the relationship already exists)
Can anyone help me?
Hi everyone. Sorry to bother you, but can anyone help me with my problem?
So you would need to build an activity table relationshit, then clicking the activity would then drill into that acitivies with attahcements etc I would think. You can't have a table render data based on another table as far as I am aware
ok, when I click on an activity linked to the customer a modal opens. Is it possible to have the attachments connected to it in this modal?
Not as a relation, since they are not renderd in modals. I would just use the view field and render it custom personally
ok, this is a problem for me
Is it possible to embed an entire resource in a tab?
No it's not, I'm not 100% sure how to achieve that
I really don't know how to solve my problem... otherwise I would have to give the user the possibility to insert only one attachment for each activity, managing the attachment as a field in the activity table
But it would be a limitation
Usually you would use spatie media manager and have a tab within the relation that saves the documents to the spatie media libary table so the tab would contain the files.
Do you have an example for me to show?
This is no example to show, just use the SpatieMedia Plugin and Filament Spatie Media Field and have the field within the form. this then saves the documents / media to the spatie media table
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
Yes
Does it also manage files or just images?
Any file
SpatieMediaLibraryFileUpload
ok, i try. Thank you very much
I get this error: Filament\Forms\Components\SpatieMediaLibraryFileUpload::Filament\Forms\Components{closure}(): Argument #2 ($record) must be of type Spatie\MediaLibrary\HasMedia, App\Models\Activity given, called in /var/www/html/evo_tsh/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
You need to install Spatie Media and add hasMedia to the model where the media is to attach too.
I installed spatie media library
You installed it, but have you applied it?
as per the Spatie Media Library documentation
class ActivityResource extends Resource implements HasMedia
{
use InteractsWithMedia;
?
sorry, I had implemented it in the resource and not in the model
why is there no fullcalendar plugin anymore?
There is
GitHub
GitHub - saade/filament-fullcalendar: The Most Popular JavaScript C...
The Most Popular JavaScript Calendar as a Filament Widget - GitHub - saade/filament-fullcalendar: The Most Popular JavaScript Calendar as a Filament Widget
just in beta