micraux
micraux
FFilament
Created by kennyhorna on 9/20/2024 in #❓┊help
Conditionally displaying delete action in a Repeater based on row
I use @awcodes TableRepeater with ->disabled() but you can do the same with the original Repeater and ->visible()...
->deleteAction(
fn (Action $action) => $action
->disabled(function (array $arguments, TableRepeater $component): bool {
$items = $component->getState();
$active_item = $items[$arguments['item']];

return $active_item['active'];
})
->deleteAction(
fn (Action $action) => $action
->disabled(function (array $arguments, TableRepeater $component): bool {
$items = $component->getState();
$active_item = $items[$arguments['item']];

return $active_item['active'];
})
11 replies
FFilament
Created by hackerman88 on 9/23/2024 in #❓┊help
Required validation on Select shows native browser error
6 replies
FFilament
Created by Thijmen on 9/20/2024 in #❓┊help
Timeout on specific computer
Could it be a cache/session issue?
17 replies
FFilament
Created by micraux on 8/2/2024 in #❓┊help
Pass parameter from RelationManager createAction to form
Ok, I managed to do it:
->beforeFormFilled(
function ($livewire) {
$livewire->mountedTableActionsData[0]['action_type'] = 'test';
}
)
->form([
Forms\Components\TextInput::make('whatever')
->default(
fn (Get $get) => $get('action_type')
),
])
->beforeFormFilled(
function ($livewire) {
$livewire->mountedTableActionsData[0]['action_type'] = 'test';
}
)
->form([
Forms\Components\TextInput::make('whatever')
->default(
fn (Get $get) => $get('action_type')
),
])
I don't know if it is the best/simplest way to do it, but that works! Thanks again, guys! 👍
17 replies
FFilament
Created by micraux on 8/2/2024 in #❓┊help
Pass parameter from RelationManager createAction to form
$formData doesn't work either...
Setting the default to the actual value doesn't really make sense though.
Yes, but how can I check if the field is populated during development? @PabloZagni : can you tell me how you can check the value of your $data['type’] (in your second screenshot) in your form?
17 replies
FFilament
Created by micraux on 8/2/2024 in #❓┊help
Pass parameter from RelationManager createAction to form
I get this message: Property [$data] not found on component: [app.filament.application.resources.client-resource.relation-managers.orders-relation-manager]
// OrderResource.php
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('action_type'),
->default(
fn ($livewire) => $livewire->data['action_type']
),
...
// OrderResource.php
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('action_type'),
->default(
fn ($livewire) => $livewire->data['action_type']
),
...
😦
17 replies
FFilament
Created by micraux on 8/2/2024 in #❓┊help
Pass parameter from RelationManager createAction to form
Hello @Dennis Koch and @PabloZagni , Thanks for helping, very much appreciated! What I am trying to achieve is, from a createAction on a RelationManager, passing a parameter to the resource form so that I can customize the resource form. My idea was to hide the action_type field because I don't need to save it in the DB. Here is an example of my code: first, I am trying to just see the value "test" in the Action Type field, then I would hide it. I don't know if it is the best way to do it.
// OrdersRelationManager.php
public function table(Table $table): Table
{
return OrderResource::table($table)
->headerActions([
Tables\Actions\createAction::make()
->beforeFormFilled(
function (array $data): array {
$data['action_type'] = 'test';
return $data;
}
)
]);
}

// OrderResource.php
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('action_type'),
...
// OrdersRelationManager.php
public function table(Table $table): Table
{
return OrderResource::table($table)
->headerActions([
Tables\Actions\createAction::make()
->beforeFormFilled(
function (array $data): array {
$data['action_type'] = 'test';
return $data;
}
)
]);
}

// OrderResource.php
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('action_type'),
...
`
17 replies
FFilament
Created by Bryan on 7/29/2024 in #❓┊help
Filament Shield Have a Default Role
Hi, You can use the boot() function in your User model:
protected static function boot(): void
{
parent::boot();

static::creating(
function($record)
{
// add your logic here...
}
);
}
protected static function boot(): void
{
parent::boot();

static::creating(
function($record)
{
// add your logic here...
}
);
}
11 replies
FFilament
Created by Satal on 7/9/2024 in #❓┊help
Remove Manage Subscription from tenant menu
Yes, probably Spark... Did you create the /billing route by yourself? You may want to try commenting this line in you Panel: ->tenantBillingProvider(new SparkBillingProvider()); and see if the link is still present...
11 replies
FFilament
Created by Satal on 7/9/2024 in #❓┊help
Remove Manage Subscription from tenant menu
Oh I see, quite strange.. I wonder where the "Manage subscription" (from Tenant menu) comes from!
11 replies
FFilament
Created by abdullafahem on 7/4/2024 in #❓┊help
Repeater Fields to TextColumn
You may have noticed that I mentioned Collection, so here: https://laravel.com/docs/11.x/collections#method-last
20 replies
FFilament
Created by abdullafahem on 7/4/2024 in #❓┊help
Repeater Fields to TextColumn
Ok, so try to display the content of $state and tell us what you have:
TextColumn::make('stages.stage.name')
->formatStateUsing(fn (string $state): string => $state)
TextColumn::make('stages.stage.name')
->formatStateUsing(fn (string $state): string => $state)
20 replies
FFilament
Created by Satal on 7/9/2024 in #❓┊help
Remove Manage Subscription from tenant menu
I don't know if I am understanding right, but as you defined 2 identical menu entries (subscription), you may see the second when you hide the first, no? Could you try just renaming your entries, like: Manage subscription (tenant) and Manage subscription (user) for better understanding/debugging?
11 replies
FFilament
Created by hentiru on 7/9/2024 in #❓┊help
Numeric TextColumn: sortable() not working properly
Are you setting a default sort?
$table
->defaultSort('priority')
$table
->defaultSort('priority')
15 replies
FFilament
Created by MZX on 7/9/2024 in #❓┊help
How to separate the breeze auth and filament auth?
So it seems that what you did doesn't work... How did you do it?
6 replies
FFilament
Created by Ethan Creft on 6/22/2024 in #❓┊help
How can I change the Label of Permission (Shield)
You can try to (re)name your second resource like this:
// In your XxxxResource.php file
protected static ?string $modelLabel = 'any label you want';
// In your XxxxResource.php file
protected static ?string $modelLabel = 'any label you want';
10 replies
FFilament
Created by zemo on 7/8/2024 in #❓┊help
Order TextColumn relationship results by desc
So, try to call only the relation and the field, like this: Tables\Columns\TextColumn::make('subscriptionYear.year')
36 replies
FFilament
Created by zemo on 7/8/2024 in #❓┊help
Order TextColumn relationship results by desc
I just tried VP's solution and it works: you can add an orderBy() in your BelongsToMany() relation. Can you show your Resource code (especially the relation)?
36 replies
FFilament
Created by zemo on 7/8/2024 in #❓┊help
Order TextColumn relationship results by desc
Oh, forget it, you don't want to reorder the table, my bad...
36 replies
FFilament
Created by zemo on 7/8/2024 in #❓┊help
Order TextColumn relationship results by desc
Not in the textColumn! Read again, the first line: $table
36 replies