© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•10mo ago•
105 replies
TranceCode

validation.required error after update filament

Hey guys i have an error after update, i check all my code and at the moment all look ok... i don't see any problem, however in the front, in the form i receive the error message validation.required.

and example of this is a toggle
here is my migration

public function up(): void
    {
        Schema::create('schedules', function (Blueprint $table) {
            $table->id();
            $table->foreignId('business_id')->constrained('businesses')->onDelete('cascade'); // Relación con el negocio
            $table->string('name');
            $table->json('days_of_week'); // Almacena múltiples días de la semana
            $table->json('time_ranges'); // Almacenamos los rangos de horarios
            $table->boolean('is_closed')->default(false);
            $table->timestamps();
        });
    }
public function up(): void
    {
        Schema::create('schedules', function (Blueprint $table) {
            $table->id();
            $table->foreignId('business_id')->constrained('businesses')->onDelete('cascade'); // Relación con el negocio
            $table->string('name');
            $table->json('days_of_week'); // Almacena múltiples días de la semana
            $table->json('time_ranges'); // Almacenamos los rangos de horarios
            $table->boolean('is_closed')->default(false);
            $table->timestamps();
        });
    }


here is my fillable in the model

protected $fillable = [
        'name',
        'time_ranges',
        'is_closed',
    ];
protected $fillable = [
        'name',
        'time_ranges',
        'is_closed',
    ];


and here is my Toogle in my form
Forms\Components\Toggle::make('is_closed')
  ->label('¿Está cerrado?')
  ->default(false)
  ->dehydrated(true)
  //->required(),
Forms\Components\Toggle::make('is_closed')
  ->label('¿Está cerrado?')
  ->default(false)
  ->dehydrated(true)
  //->required(),


however i have this error when i try to save the data
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'is_closed' cannot be null (Connection: mysql, SQL: insert into `schedules` (`name`, `time_ranges`, `is_closed`, `business_id`, `updated_at`, `created_at`) values (Corte de pelo, [{"apply_to_days":["0","1"],"opening_time":"08:00:00","closing_time":"09:15:00"}], ?, 1, 2025-05-07 19:43:08, 2025-05-07 19:43:08))
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'is_closed' cannot be null (Connection: mysql, SQL: insert into `schedules` (`name`, `time_ranges`, `is_closed`, `business_id`, `updated_at`, `created_at`) values (Corte de pelo, [{"apply_to_days":["0","1"],"opening_time":"08:00:00","closing_time":"09:15:00"}], ?, 1, 2025-05-07 19:43:08, 2025-05-07 19:43:08))
image.png
Solution
Yesterday I had the same problem then and applied as a solution to use cluster, I have a form in which I add or create new categories of services but I got a similar error ... then I checked, checked, found out, used AI, and nothing, it only occurred to me to jump to create the category in a model and resource apart and from there call it in the other resource, but now I see that it persisted in another resource, well the one we saw now ... It is strange if on the one hand because this has not happened to me for weeks, until now after having it working for weeks hahahaha maybe the update I did a few days ago deleted cache or something ... I don't know, very strange at the time, but now it is understood why!
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Next page

Similar Threads

Error with Filament after composer update
FilamentFFilament / ❓┊help
3y ago
translate validation.required?
FilamentFFilament / ❓┊help
12mo ago
conditionally required validation
FilamentFFilament / ❓┊help
16mo ago
Getting a `required` validation error when running the `make:filament-widget` command
FilamentFFilament / ❓┊help
3y ago