mathan7136
mathan7136
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
No description
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
when i using this code. ->hidden(function($component) { $uuid = collect(explode('.', $component->getStatePath())) ->slice(0, -2) ->pop(); return collect($this->getFormStatePath())->keys()->search($uuid) !== 0; }), primary hidden permanently !!!, i need to hide only in first element my results, dd(uuid) = applicants
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
okay sir
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
i tried this also but when i click primary in seconf form, the first one's primary automatically visibled ->hidden(function() { static $position = 0; $position++; if($position == 1) { return true; } }),
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
No description
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
Any ideas Sir?
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
Forms\Components\Toggle::make('primary') ->label('Primary Applicant') ->hidden(function() { static $position = 0; $position++; if($position === 1) { return true; } }),
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
i tried this but when toggle second fom's toggle element then the first form toggle also visible problem!!
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
if it graeter than one i need to show in child fotm not in parent form sir
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
In this condition i need to add '<', after i add this ->hidden(fn(\Filament\Forms\Get $get) => count($get('../../applicants')) == 1),its working but when i click add another its showing in both parent and child forms
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
App\Filament\Frontend\Resources\ApplicationResource\Pages\Edit\Applicants::App\Filament\Frontend\Resources\ApplicationResource\Pages\Edit{closure}(): Argument #1 ($get) must be of type Closure, Filament\Forms\Get given, called in /Users/ranium/Desktop/sites/projects/caseflow-main/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
i got following error sir
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
trying to hide in first form sir !!
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
primary sir !
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
protected function baseFormSchema(array $repeaterComponents): array { return [ $this->descriptionPlaceholder(), Repeater::make('applicants') ->relationship() ->schema($repeaterComponents) ->mutateRelationshipDataBeforeSaveUsing(function (array $data, Model $record): array { // Check if 'meta' exists in both $data and $record if (isset($data['meta']) && isset($record->meta)) { // Merge the 'meta' data from the record with the new data $data['meta'] = array_merge_recursive($record->meta, $data['meta']); } return $data; }) ->itemLabel(fn (array $state) => "{$state['firstname']} {$state['lastname']}"), ]; }
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
its called from here sir
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
Any updates sir
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
public function form(Form $form): Form { $formSpecificComponents = [ Forms\Components\Grid::make(3) ->schema( [ Forms\Components\TextInput::make('firstname') ->required() ->label('Firstname') ->required() ->maxLength(255) ->live(), Forms\Components\TextInput::make('middlename') ->label('Middlename') ->maxLength(255), Forms\Components\TextInput::make('lastname') ->required() ->label('Lastname') ->maxLength(255) ->live(), Forms\Components\DatePicker::make('date_of_birth') ->required(), Forms\Components\Select::make('meta.country_of_birth') ->options(Country::all()->pluck('name', 'id')) ->searchable() ->required(), Forms\Components\TextInput::make('meta.town_of_birth') ->maxLength(255) ->required(), Forms\Components\Toggle::make('primary') ->label('Primary Applicant'), ] ), ]; return $form->schema($this->baseFormSchema($formSpecificComponents)); }
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
in doc?
36 replies
FFilament
Created by mathan7136 on 9/14/2023 in #❓┊help
How to hide one field in repeater form ( only in first element )??
Is any example for this??
36 replies