skip to Main Content

This is my model
enter image description here

This is my Controller
enter image description here

This is my Route

    Route::post('consultation_form', [ConsultationController::class,'addConsultation']);

2

Answers


  1. This means your not providing a value for the item_name field when you are trying to insert a record for the consultation model.

    The input being provided is most likely empty, and MYSQL is giving you an error because your database wasn’t setup for that field to have a default value when one isn’t provided.

    Login or Signup to reply.
  2. Put

    $table->string('item_name')->nullable();
    

    Or if you want a default name.

    $table->string('item_name')->default('item_default_name); 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search