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
NeerGreeN
NeerGreeNOP15mo ago
Something like this
NeerGreeN
NeerGreeNOP15mo ago
No description
NeerGreeN
NeerGreeNOP15mo ago
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?
NeerGreeN
NeerGreeNOP15mo ago
No description
NeerGreeN
NeerGreeNOP15mo ago
Hi everyone. Sorry to bother you, but can anyone help me with my problem?
toeknee
toeknee15mo ago
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
NeerGreeN
NeerGreeNOP15mo ago
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?
NeerGreeN
NeerGreeNOP15mo ago
No description
toeknee
toeknee15mo ago
Not as a relation, since they are not renderd in modals. I would just use the view field and render it custom personally
NeerGreeN
NeerGreeNOP15mo ago
No description
NeerGreeN
NeerGreeNOP15mo ago
ok, this is a problem for me Is it possible to embed an entire resource in a tab?
toeknee
toeknee15mo ago
No it's not, I'm not 100% sure how to achieve that
NeerGreeN
NeerGreeNOP15mo ago
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
toeknee
toeknee15mo ago
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.
NeerGreeN
NeerGreeNOP15mo ago
Do you have an example for me to show?
toeknee
toeknee15mo ago
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
NeerGreeN
NeerGreeNOP15mo ago
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
toeknee
toeknee15mo ago
Yes
NeerGreeN
NeerGreeNOP15mo ago
Does it also manage files or just images?
toeknee
toeknee15mo ago
Any file SpatieMediaLibraryFileUpload
NeerGreeN
NeerGreeNOP15mo ago
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
toeknee
toeknee15mo ago
You need to install Spatie Media and add hasMedia to the model where the media is to attach too.
NeerGreeN
NeerGreeNOP15mo ago
I installed spatie media library
toeknee
toeknee15mo ago
You installed it, but have you applied it? as per the Spatie Media Library documentation
NeerGreeN
NeerGreeNOP15mo ago
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?
toeknee
toeknee15mo ago
There is
toeknee
toeknee15mo ago
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
toeknee
toeknee15mo ago
just in beta
Want results from more Discord servers?
Add your server