frame
frame
FFilament
Created by frame on 4/23/2025 in #❓┊help
Rich editor or Tiptap Editor plugin
Filament v4 is rumored to include Tiptap. If I was planning to upgrade from v3 to v4 next year, and wanted to start writing some rich text with images today, should I be doing that using the currently included Rich editor or a Tiptap plugin? Or is the outputted HTML similar enough to not even matter?
4 replies
FFilament
Created by frame on 4/16/2025 in #❓┊help
Prevent form from closing and show error on action form submit
Is it possible to prevent the form from closing and display an error message when an action form submit fails? I want to run a DB transaction in ->after (or another similar lifecycle method), and if it fails I don't want the form to submit, but instead show what went wrong.
Tables\Actions\Action::make('upload csv')
->form(function (Form $form) {
return $form->schema([
FileUpload::make('csv')
]);
})
->after(function ($data, Component $livewire) use ($group) {
$imports = Csv::readCsv($data['csv']->getPathName());
$members = AddToGroup::addMembers($group, $imports); // throws
Tables\Actions\Action::make('upload csv')
->form(function (Form $form) {
return $form->schema([
FileUpload::make('csv')
]);
})
->after(function ($data, Component $livewire) use ($group) {
$imports = Csv::readCsv($data['csv']->getPathName());
$members = AddToGroup::addMembers($group, $imports); // throws
14 replies
FFilament
Created by frame on 4/8/2025 in #❓┊help
Reset Grid/Fieldset column
Can I reset grid column position to make sure a field starts from the beginning of a new row when using a Grid or a Section?
3 replies
FFilament
Created by frame on 3/31/2025 in #❓┊help
Translation via filament panel
Has anyone found a good way to create and update translations for missing __() strings, validation error messages, etc. via filament admin? 🤔 There's quite a few filament plugins for spatie-translate but that's only for model attributes I think.
2 replies
FFilament
Created by frame on 3/24/2025 in #❓┊help
Share data from `CreateRecord::handleRecordCreation` to `getRedirectUrl`
I'm contacting the payment processor within handleRecordCreation to retrieve a redirect url. How can I pass that url to getRedirectUrl so the user is automatically redirected to the payment page? 🤔 Alternatively if I contact the processor in afterCreate is it possible to redirect the user from there?
4 replies
FFilament
Created by frame on 3/24/2025 in #❓┊help
Return Exception from handleRecordCreation
How can I return some visible error for the user from a validation or other exception that happened in protected function handleRecordCreation(array $data): Model? https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-the-creation-process
2 replies
FFilament
Created by frame on 3/21/2025 in #❓┊help
Testing ListResources page with tenancy (missing parameter: tenant)
What am I missing here? 🤔
test('lists groups', function () {
livewire(GroupResource\Pages\ListGroups::class, [
'tenant' => $this->client->uuid,
])->assertOk();
});
test('lists groups', function () {
livewire(GroupResource\Pages\ListGroups::class, [
'tenant' => $this->client->uuid,
])->assertOk();
});
Missing required parameter for [Route: filament.instructors.resources.groups.index] [URI: instructors/{tenant}/groups] [Missing parameter: tenant]
Missing required parameter for [Route: filament.instructors.resources.groups.index] [URI: instructors/{tenant}/groups] [Missing parameter: tenant]
GET|HEAD instructors/{tenant}/groups ... filament.instructors.resources.groups.index › App\Filament\Instructors\Resources\GroupResource\Pages\ListGroups
GET|HEAD instructors/{tenant}/groups ... filament.instructors.resources.groups.index › App\Filament\Instructors\Resources\GroupResource\Pages\ListGroups
4 replies
FFilament
Created by frame on 3/1/2025 in #❓┊help
Persist form inputs to query string
You can persist the current step of a wizard (https://filamentphp.com/docs/3.x/forms/layout/wizard#persisting-the-current-step-in-the-urls-query-string) but how would you also persist the already input data to the query string so redirects/refresh etc. would work without losing the data? 🤔
6 replies
FFilament
Created by frame on 2/25/2025 in #❓┊help
Custom form handling
Is there something like https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#customizing-the-creation-process but for forms? I want to do some http requests and manually create models when form is submitted. Or do I need to use regular laravel observers? 😶‍🌫️
4 replies
FFilament
Created by frame on 1/24/2025 in #❓┊help
Filament blade components on a non-panel page
Maybe I'm missing something but if I render something like <x-filament::badge color="success"> in a regular livewire component how do I get the colors to work? 🤔 The rendered badge tries to refer to text-custom-600 etc. but how do I import them?
8 replies
FFilament
Created by frame on 1/15/2025 in #❓┊help
Style tenant dropdown when user only has access to a single tenant
I would like to remove hover effects and the arrow down icon if the user only has a single tenant. Is that possible? I am not using a tenant profile page or other tenant menu items.
9 replies
FFilament
Created by frame on 1/15/2025 in #❓┊help
Highlight changed/added rows using $table->recordClasses
I want to highlight rows that were changed or added until the user navigates away or does another change. I tried saving record IDs with session()->flash, but the rows are only highlighted for half a second until the notification appears and the table is redrawn without session flash. Are there better ways to temporarily save highlighted row IDs for a user so I could use it in recordClasses? 🤔
2 replies
FFilament
Created by frame on 1/14/2025 in #❓┊help
Overriding Filepond labels
uploadingMessage corresponds to labelFileLoading but can I also override the other labels? https://pqina.nl/filepond/docs/api/instance/properties/#labels
4 replies
FFilament
Created by frame on 1/14/2025 in #❓┊help
FileUpload file validation after upload, before submit
Is it possible to validate a FileUpload field before submit? I can access the uploaded file using afterStateUpdated and similar functions, but is there any function other than rules that has access to $fail? I tried throwing ValidationError, etc but those didn't seem to work.
5 replies
FFilament
Created by frame on 1/13/2025 in #❓┊help
How to submit disabled fields
Is there something similar to immutable fields from Nova in Filament, so submit the field even if its disabled for the user. Or do I always need a pairing Hidden input for that use case? I tried readOnly but it's only available on Textinput. https://nova.laravel.com/docs/v5/resources/fields#immutable-fields
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Custom resource page $this->record null when searching/sorting
The table renders fine initially, but when trying to sort or search $this->record is null. Am I missing some trait or something? 🤔 Same question as this removed one https://discord.com/channels/883083792112300104/1301012727036121219
<?php

namespace App\Filament\Instructors\Resources\GroupResource\Pages;

use App\Filament\Instructors\Resources\GroupResource;
use App\Models\ExerciseResult;
use App\Models\Group;
use Filament\Actions\Concerns\InteractsWithRecord;
use Filament\Actions\Contracts\HasRecord;
use Filament\Resources\Pages\Page;
use Filament\Tables;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;

class SimpleResults extends Page implements HasRecord, HasTable
{
use InteractsWithRecord;
use InteractsWithTable;

public function mount(string $record): void
{
$this->record = Group::where('uuid', $record)->firstOrFail();
}

protected static string $resource = GroupResource::class;

protected static string $view = 'filament.instructors.resources.group-resource.pages.simple-results';

public function getModel(): string
{
return Group::class;
}

public function table(Table $table)
{
return $table
->query(function () {
dump($this->record); // null if searching/sorting

return ExerciseResult::forGroup($this->record);
})
->columns([
Tables\Columns\TextColumn::make('created_at')
->label('Created at')
->sortable()
->searchable(),
])
->actions([]);
}
}
<?php

namespace App\Filament\Instructors\Resources\GroupResource\Pages;

use App\Filament\Instructors\Resources\GroupResource;
use App\Models\ExerciseResult;
use App\Models\Group;
use Filament\Actions\Concerns\InteractsWithRecord;
use Filament\Actions\Contracts\HasRecord;
use Filament\Resources\Pages\Page;
use Filament\Tables;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;

class SimpleResults extends Page implements HasRecord, HasTable
{
use InteractsWithRecord;
use InteractsWithTable;

public function mount(string $record): void
{
$this->record = Group::where('uuid', $record)->firstOrFail();
}

protected static string $resource = GroupResource::class;

protected static string $view = 'filament.instructors.resources.group-resource.pages.simple-results';

public function getModel(): string
{
return Group::class;
}

public function table(Table $table)
{
return $table
->query(function () {
dump($this->record); // null if searching/sorting

return ExerciseResult::forGroup($this->record);
})
->columns([
Tables\Columns\TextColumn::make('created_at')
->label('Created at')
->sortable()
->searchable(),
])
->actions([]);
}
}
5 replies
FFilament
Created by frame on 1/10/2025 in #❓┊help
Query string null in a relationmanager
I can read request()->query('group') in ViewUser::getTitle just fine but in UserResource's ResultsRelationManager it returns null. Is there a way to read URL query strings in a relationmanager, or some other way to pass data from Resource to Relationmanager? I need to alter both UserResource infolist and the ResultsRelationManager table under it based on this query string. 🤔
13 replies
FFilament
Created by frame on 1/3/2025 in #❓┊help
How to redirect panel base path to resource index
If I don't need a dashboard how do i redirect the base /admin path to for example UserResource list?
4 replies
FFilament
Created by frame on 1/2/2025 in #❓┊help
Mystery `Action::table` method missing
I want to create my own import action by modifying Filament's ImportAction. But I'm missing the table method, does anyone know how I'm supposed to provide it? 🤔
Method App\Filament\MyImportAction::table does not exist.
C:\Herd\project\vendor\filament\support\src\Concerns\Macroable.php:72
Method App\Filament\MyImportAction::table does not exist.
C:\Herd\project\vendor\filament\support\src\Concerns\Macroable.php:72
4 replies
FFilament
Created by frame on 12/31/2024 in #❓┊help
Adding where clause to query using current session
Can I always filter UserResource rows to only rows that belong to the same group as the current logged in user ($query->where('group_id', auth()->user()->group_id)? Where would I apply such a where clause? getTableQuery says deprecated — Override the table() method to configure the table so I'm not sure how to do it 🤔
6 replies