DatePickers validation in differents Wizard's steps

Hello, I'm stuck on validating a date. Let me explain:

I have a Wizard that has two Steps (Expeditions and Samples)

A shipment can have one or more samples.

  • the Expedition step I have a 'date_depart' field
  • The Samples step, which is a repeater, I have a 'date_sampling' field which must be less than or equal to 'date_depart'
In my Samples step, I have this:

DatePicker::make('date_prelevement')
      ->required()
      ->rules(['date'])
      ->beforeOrEqual('date_depart')
      ->label('Date de prélevement')
      ->placeholder('Choisir la date de prélevement')
      ->columnSpan([
           'default' => 12,
           'md' => 12,
           'lg' => 12,
       ]),


With this code, I have the impression that the 'date_depart' field is unknown to it.

Can you enlighten me please
Was this page helpful?