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
NeerGreeNOP16mo ago
Something like this
NeerGreeN
NeerGreeNOP16mo ago
No description
NeerGreeN
NeerGreeNOP16mo 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
NeerGreeNOP16mo ago
No description
NeerGreeN
NeerGreeNOP16mo ago
Hi everyone. Sorry to bother you, but can anyone help me with my problem?
toeknee
toeknee16mo 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
NeerGreeNOP16mo 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
NeerGreeNOP16mo ago
No description
toeknee
toeknee16mo 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
NeerGreeNOP16mo ago
No description
NeerGreeN
NeerGreeNOP16mo ago
ok, this is a problem for me Is it possible to embed an entire resource in a tab?
toeknee
toeknee16mo ago
No it's not, I'm not 100% sure how to achieve that
NeerGreeN
NeerGreeNOP16mo 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
toeknee16mo 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
NeerGreeNOP16mo ago
Do you have an example for me to show?
toeknee
toeknee16mo 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
NeerGreeNOP16mo ago
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
toeknee
toeknee16mo ago
Yes
NeerGreeN
NeerGreeNOP16mo ago
Does it also manage files or just images?
toeknee
toeknee16mo ago
Any file SpatieMediaLibraryFileUpload
NeerGreeN
NeerGreeNOP16mo 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
toeknee16mo ago
You need to install Spatie Media and add hasMedia to the model where the media is to attach too.
NeerGreeN
NeerGreeNOP16mo ago
I installed spatie media library
toeknee
toeknee16mo ago
You installed it, but have you applied it? as per the Spatie Media Library documentation
NeerGreeN
NeerGreeNOP16mo 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
toeknee16mo ago
There is
toeknee
toeknee16mo 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
toeknee16mo ago
just in beta

Did you find this page helpful?