gemini.dev
gemini.dev
FFilament
Created by gemini.dev on 10/13/2024 in #❓┊help
Add TextArea as a blade component
I'm currently looking at this documentation: https://filamentphp.com/docs/3.x/support/blade-components/input Is there a way to add textarea in blade? This is the component I am reffering to: https://filamentphp.com/docs/3.x/forms/fields/textarea
3 replies
FFilament
Created by gemini.dev on 8/12/2024 in #❓┊help
Cannot close modal after validation
I have a page that shows a custom column: public function table(Table $table): Table { $user = auth()->user(); $client = Client::query()->where('id', $user->client_id)->first(); return $table ->query($client()->getQuery()) ->columns( [ ViewColumn::make('deadlines') ->label('Deadlines') ->view('filament.tables.columns.client.deadlines') ] ); } In the custom column Blade.php file, there is a modal that includes a header, content, and a Filament button to trigger a function called submit: <x-filament::modal :close-button="true" id="test" width="xl"> <x-slot name="heading"> Heading </x-slot> <!-- Modal Content --> <div> {{ $this->form }} </div> <x-slot name="footer"> <x-filament::button style="float: right;" wire:click="submit()"> Submit </x-filament::button> </x-slot> </x-filament::modal> This is the form: public function form(Form $form): Form { return $form ->schema([ \Filament\Forms\Components\TextInput::make('test_field')->required() ]); } This is the submit function: public function submit(): void { // Validate the data $validatedData = $this->form->validate(); } There is also a button to open the modal on click: x-on:click="$dispatch('open-modal', {id: 'test'})" Issue When I open the modal and click anywhere outside the modal, or on the close icon in the top right corner, the modal closes as expected. However, if I open the modal, leave the TextInput field blank, and click Submit, the submit button shows a spinning icon and then displays a validation error message. After the validation message is displayed, if I try to close the modal, it does not close.
48 replies
FFilament
Created by gemini.dev on 8/11/2024 in #❓┊help
Modal does not show close button by default, on custom columns
I have a page that shows a custom column: public function table(Table $table): Table { $user = auth()->user(); $client = Client::query()->where('id', $user->client_id)->first(); return $table ->query($client()->getQuery()) ->columns( [ ViewColumn::make('deadlines') ->label('Deadlines') ->view('filament.tables.columns.client.deadlines') ] ); } In the custom column Blade.php file, there is a modal inside it: <x-filament::modal :close-button="true" id="test" width="xl"> test </x-filament::modal> There is also a button to open the modal on click: x-on:click="$dispatch('open-modal', {id: 'test'})" Problem According to the documentation: By default, modals have a close button in the top right corner. https://filamentphp.com/docs/3.x/support/blade-components/modal#hiding-the-modal-close-button However, this is not the case for me. The close button is not displayed.
5 replies
FFilament
Created by gemini.dev on 6/12/2024 in #❓┊help
Scroll to invalid field.
If you have a vertically long form and you click submit at the bottom of the page, is it possible to automatically scroll to the first invalidated field instead of needing to scroll to it manually?
2 replies
FFilament
Created by gemini.dev on 6/11/2024 in #❓┊help
Hide helperText in ViewMode
No description
3 replies
FFilament
Created by gemini.dev on 6/9/2024 in #❓┊help
How to change a label for a field, in view page?
No description
5 replies
FFilament
Created by gemini.dev on 6/2/2024 in #❓┊help
How to check if filename uploaded, already exists?
No description
3 replies
FFilament
Created by gemini.dev on 4/21/2024 in #❓┊help
Get data at ManageRecords
Before I create the record. I need to get the current state (current values) of the fields. How can I achieve so in my hello function? Similar to this post https://discord.com/channels/883083792112300104/1197452689135652894 <?php namespace App\Filament\Resources\DataResource\Pages; use App\Filament\Resources\DataResource; use App\Helpers\Helpers; use Filament\Pages\Actions\CreateAction; use Filament\Resources\Pages\ManageRecords; use Illuminate\Database\Eloquent\Collection; use Filament\Forms\Components\Actions\Action; class ManageData extends ManageRecords { protected static string $resource = DataResource::class; protected function getActions(): array { $records = new Collection(); return [ CreateAction::make() ->disableCreateAnother() ->using(function (array $data) use (&$records) { foreach ($data['filename'] as $filename) { $records[] = static::getModel()::create(['filename' => $filename]); } }) ->after(function (array $data) use ($records): ?\Symfony\Component\HttpFoundation\StreamedResponse { if (isset ($data['generate_pdf_files']) && $data['generate_pdf_files'] === true) { $response = Helpers::generatePDF($data, $records); return $response; } return null; }) ]; } public function hello() { // get data here dd(); } protected function getTableRecordsPerPageSelectOptions(): array { return [50, 100]; } }
4 replies
FFilament
Created by gemini.dev on 3/10/2024 in #❓┊help
Text to be copied to the clipboard
No description
5 replies
FFilament
Created by gemini.dev on 12/28/2023 in #❓┊help
Relation manager - set isReadOnly() in v2
Hi, I've noticed that in v2, there is no isReadOnly() override for the relation manager: https://filamentphp.com/docs/2.x/admin/resources/relation-managers#viewing-records However, the v3 version does include it: https://filamentphp.com/docs/3.x/panels/resources/relation-managers#read-only-mode My issue is that my project is running on v2. When I view a record, it displays the initial panel with fields in view mode. Beneath that panel, the relation manager panel appears, but I'm able to edit the data in the relation manager panel. How can I set it to view mode?
2 replies
FFilament
Created by gemini.dev on 12/11/2023 in #❓┊help
Upgrade from v2 to v3 but running into a problem
No description
17 replies
FFilament
Created by gemini.dev on 12/10/2023 in #❓┊help
SelectFilter show full name
I currently have this filter added in: SelectFilter::make('agent_id')->label('Agent')->relationship('filamentUser', 'first_name') It only shows me first_name values. I need to show both first_name and last_name. How can I achieve this?
16 replies