br1
br1
FFilament
Created by br1 on 3/13/2025 in #❓┊help
Compound key validation at Form's DatePicker
Given this migration: Schema::table('incomes', function (Blueprint $table): void { $table->date('emission_date') ->nullable(false) ->change(); $table->unique(['user_id', 'emission_date'], 'user_emission_date_unique'); }); Where emission_date is always normalized to: $income->emission_date = Carbon::parse($income->emission_date)->startOfMonth(); Before create, I have to check that it doesn't exists any register with that compound key (user_emission_date_unique) at the following form of a Resource: public static function form(Form $form): Form { Log::info('form: ' . PanelUrlHelper::getUserIdFromUrl()); return $form ->schema([ TextInput::make('user_id') ->label('ID de usuario') ->default(PanelUrlHelper::getUserIdFromUrl()) ->readOnly(), TextInput::make('amount') ->label('Monto') ->numeric() ->inputMode('decimal'), DatePicker::make('emission_date') ->label('Fecha de Emisión') ->native(false) ->displayFormat('d/m/Y') ->closeOnDateSelection() ->seconds(false) ->required() ->unique() , ]); } I tried different ways, even with custom rules, but I can't get it. As can you see I've logged the user_id extracted from url and I obtained that the form it's getting rendered twice, once with the id and other with the id = 0: [2025-03-13 12:50:54] testing.INFO: form: 530759726002900 [2025-03-13 12:50:59] testing.INFO: form: 0
3 replies
FFilament
Created by br1 on 2/19/2025 in #❓┊help
change position of global search
Hello everyone! Is there any way of changing the global search position? I want to put it in the center of the navbar I tried with RenderHooks but I don't understand the concept completely.
7 replies