James
James
FFilament
Created by CGM on 5/17/2024 in #❓┊help
How do I pass values through a render hook?
You can add the record id in the getRenderHookScopes method of (e.g.) the ViewRecord class, so put in something like:
public function getRenderHookScopes(): array
{
return [ ...parent::getRenderHookScopes(), $this->record->id ];
}
public function getRenderHookScopes(): array
{
return [ ...parent::getRenderHookScopes(), $this->record->id ];
}
So then in the render hook you can access that id like:
FilamentView::registerRenderHook(
PanelsRenderHook::PAGE_HEADER_WIDGETS_BEFORE,
fn (array $scopes) => Report::find(end($scopes))->description,
scopes: [
ViewUsersReport::class,
],
);
FilamentView::registerRenderHook(
PanelsRenderHook::PAGE_HEADER_WIDGETS_BEFORE,
fn (array $scopes) => Report::find(end($scopes))->description,
scopes: [
ViewUsersReport::class,
],
);
It's nasty, and I wil be adding some more checks to this to prevent crashes etc. but the idea works.
7 replies
FFilament
Created by CGM on 5/17/2024 in #❓┊help
How do I pass values through a render hook?
I've run across the same thing, and found a different slightly hacky approach:
7 replies
FFilament
Created by Skrypt on 4/27/2024 in #❓┊help
Action Modal on Simple Pages?
(this is in getAction in IntertactsWithActions.php)
9 replies
FFilament
Created by Skrypt on 4/27/2024 in #❓┊help
Action Modal on Simple Pages?
if ( (! str($name)->endsWith('Action')) && method_exists($this, "{$name}Action") ) { $methodName = "{$name}Action"; } elseif (method_exists($this, $name)) { $methodName = $name; } else { return null; }
9 replies
FFilament
Created by Skrypt on 4/27/2024 in #❓┊help
Action Modal on Simple Pages?
The key part in source code is here:
9 replies
FFilament
Created by Skrypt on 4/27/2024 in #❓┊help
Action Modal on Simple Pages?
I had this issue and I found it was due to my action method name 'integrateActivityAction' didn't match the string in Action:make('integrateActivity').
9 replies
FFilament
Created by Frank Wiebe on 3/23/2024 in #❓┊help
Access the current tenant in the importer resolveRecord() method
P.S Hooks are of no use as they are executred by the queue worker, so wont have access to tenant either
8 replies
FFilament
Created by Frank Wiebe on 3/23/2024 in #❓┊help
Access the current tenant in the importer resolveRecord() method
Would not be a good idea to get the current tenant incase the tenant switches before the job completes 😉
8 replies
FFilament
Created by Frank Wiebe on 3/23/2024 in #❓┊help
Access the current tenant in the importer resolveRecord() method
You can set options on the action, which are serialized in the jobs table and can be accessed via the importer $this->options, so you can set the tenant_id there: https://discord.com/channels/883083792112300104/1179875310221660251/1235250103284138004
8 replies
FFilament
Created by Maarten Paauw on 11/30/2023 in #❓┊help
ImportAction in combination with tenancy
You can access this in the resolveRecord actions
9 replies
FFilament
Created by Maarten Paauw on 11/30/2023 in #❓┊help
ImportAction in combination with tenancy
public function resolveRecord(): ?Participant { $participant = Participant::firstOrNew([ 'email' => $this->data['email'], ]); $participant->trial_id = $this->options['tenant_id']; return $participant; }
9 replies
FFilament
Created by Maarten Paauw on 11/30/2023 in #❓┊help
ImportAction in combination with tenancy
Pass an options with the import action and then...
9 replies
FFilament
Created by Maarten Paauw on 11/30/2023 in #❓┊help
ImportAction in combination with tenancy
Tables\Actions\ImportAction::make() ->importer(ParticipantImporter::class) ->options(['tenant_id' => Filament::getTenant()->id]),
9 replies
FFilament
Created by Maarten Paauw on 11/30/2023 in #❓┊help
ImportAction in combination with tenancy
Woo hoo I found an answer for this
9 replies
FFilament
Created by David Chong 1228 on 1/5/2024 in #❓┊help
Any one who how to Freeze Table Column or Row
The bg colours need to be set as their bg is by default transparent
8 replies
FFilament
Created by David Chong 1228 on 1/5/2024 in #❓┊help
Any one who how to Freeze Table Column or Row
using position: sticky and left to freeze column. You also have to set the bg colour. It's not perfect with bg in dark mode unfortuantely as the header has a transparent shade rather than a fixed colour, but this looks good enough....
8 replies
FFilament
Created by David Chong 1228 on 1/5/2024 in #❓┊help
Any one who how to Freeze Table Column or Row
TextColumn::make('user.loginCode.code')
->label('Code')
->extraHeaderAttributes([
'style' => 'position: sticky; left: 0; z-index: 1;',
'class' => 'bg-gray-50 dark:bg-gray-900',
])
->extraCellAttributes([
'style' => 'position: sticky; left: 0; z-index: 1;',
'class' => 'bg-white dark:bg-gray-900',
])
TextColumn::make('user.loginCode.code')
->label('Code')
->extraHeaderAttributes([
'style' => 'position: sticky; left: 0; z-index: 1;',
'class' => 'bg-gray-50 dark:bg-gray-900',
])
->extraCellAttributes([
'style' => 'position: sticky; left: 0; z-index: 1;',
'class' => 'bg-white dark:bg-gray-900',
])
8 replies
FFilament
Created by David Chong 1228 on 1/5/2024 in #❓┊help
Any one who how to Freeze Table Column or Row
solution:
8 replies
FFilament
Created by David Chong 1228 on 1/5/2024 in #❓┊help
Any one who how to Freeze Table Column or Row
I think he means to make it so a column doesn't scroll, e.g. on the left if its someones name or an id
8 replies