Adding a form to a Livewire component

this is the schema for the migration on my contact-us-messages
    public function up(): void
    {
        Schema::create('contact_messages', function (Blueprint $table) {
            $table->id();
            $table->string("first_name", 100);
            $table->string("last_name", 100);
            $table->string("email")->index();
            $table->string("phone_number", 20)->nullable();
            $table->text("message");
            $table->string("ip_address", 45)->nullable(); 
            $table->timestamps();
        });
    }

php artisan make:livewire-form CreateCm --generate

What is the model name?
❯ ContactMessages

Which namespace would you like to create this in?
Create
❯ 0

and was able to display the form @livewire('create-cm')

the issue is when submitting messages via the form schema
Forms\Components\Textarea::make('message')
->required()
->columnSpanFull(),

even if i enter texts in the message part i am getting
"The message field is required."

i also tried using richtext and it also wouldn't work. hmmm no issue if changing it to TextInput
image.png
Was this page helpful?