Passenger
Passenger
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
Check that you've imported from the correct name space. use Filament\Actions\Action;
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
You don't need to call render on the action. Just {{ $this->deleteAction }} is enough. Also. You should name your action to match the method name. So deleteAction() function should return Action::make('delete')->....
23 replies
FFilament
Created by Passenger on 1/14/2024 in #❓┊help
Calling `callMountedFormComponentAction` with arguments does not not pass it into the
Oh. I meant a I used a native component instead of the custom component I was building. It was less ideal UX for the project, but we were on a crunch. Sorry I couldn't be of more help
12 replies
FFilament
Created by Passenger on 1/14/2024 in #❓┊help
Calling `callMountedFormComponentAction` with arguments does not not pass it into the
Thanks for helping to create the issue. I have since resolved this in a different way. Its my fault for using an internal undocumented method 🤷
12 replies
FFilament
Created by DitIsMik on 8/8/2023 in #❓┊help
Easy way to update background color of the panel?
.fi-main-ctn { @apply bg-red-500 }
.fi-main-ctn { @apply bg-red-500 }
6 replies
FFilament
Created by Lambertn33 on 5/31/2023 in #❓┊help
Custom JS in filament page
Yes, not as convenient, as i'd need to keep running php artisan filament:assets but that works. Thanks
15 replies
FFilament
Created by Lambertn33 on 5/31/2023 in #❓┊help
Custom JS in filament page
@push('scripts') seems to be broken in v3. Worked fine in v2..
15 replies
FFilament
Created by miomech on 7/21/2023 in #❓┊help
Filament v2 Is it possible to render a relation manager outside of the admin dashboard on blade
Make sure to call $this->loadRelationManagers() when your component pounts/page loads.
8 replies
FFilament
Created by miomech on 7/21/2023 in #❓┊help
Filament v2 Is it possible to render a relation manager outside of the admin dashboard on blade
Yes, it is possible. You'd need to mount the relation managers on your component.
protected function getRelationManagers(): array
{
$managers = $this->getResource()::getRelations();

return array_filter(
$managers,
function (string | RelationGroup $manager): bool {
if ($manager instanceof RelationGroup) {
return (bool) count($manager->getManagers(ownerRecord: $this->getOwnerRecord()));
}

return $manager::canViewForRecord($this->getOwnerRecord());
},
);
}

public function loadRelationManagers(): void
{
$managers = $this->getRelationManagers();

if (array_key_exists($this->activeRelationManager, $managers)) {
return;
}
$this->relationManagers = $managers;
$this->activeRelationManager = array_key_first($this->relationManagers) ?? null;
}

public function getOwnerRecord()
{
//return the $parentModel.
// return $this->ownerRecord = $this->getTableQuery()->find($this->recordId);
}
protected function getRelationManagers(): array
{
$managers = $this->getResource()::getRelations();

return array_filter(
$managers,
function (string | RelationGroup $manager): bool {
if ($manager instanceof RelationGroup) {
return (bool) count($manager->getManagers(ownerRecord: $this->getOwnerRecord()));
}

return $manager::canViewForRecord($this->getOwnerRecord());
},
);
}

public function loadRelationManagers(): void
{
$managers = $this->getRelationManagers();

if (array_key_exists($this->activeRelationManager, $managers)) {
return;
}
$this->relationManagers = $managers;
$this->activeRelationManager = array_key_first($this->relationManagers) ?? null;
}

public function getOwnerRecord()
{
//return the $parentModel.
// return $this->ownerRecord = $this->getTableQuery()->find($this->recordId);
}
Then in your blade file you can render something like this
@if (count($relationManagers))
<x-filament::hr />

<x-filament::resources.relation-managers
:active-manager="$activeRelationManager"
:managers="$relationManagers"
:owner-record="$ownerRecord"
:page-class="static::class"
>
</x-filament::resources.relation-managers>
@endif
@if (count($relationManagers))
<x-filament::hr />

<x-filament::resources.relation-managers
:active-manager="$activeRelationManager"
:managers="$relationManagers"
:owner-record="$ownerRecord"
:page-class="static::class"
>
</x-filament::resources.relation-managers>
@endif
8 replies