vendredi 30 août 2019

The column exists but cannot be saved

The column exists but cannot be saved
index.blade.php

<form action="" method="post">
@csrf
<input type="hidden" name="project_id" value="">

WorkController.php

public function store(Request $request,$id)
{
    $work = new Work;
    $work->fill($request->all())->save();
    return redirect()->route('workindex', ['id' => $id]);
}

create_work_table.php

    Schema::create('work', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->integer('project_id');
        $table->text('content');
        $table->integer('user_id');
        $table->time('work_time');
        $table->string('input_person');
        $table->timestamp('input_date');

        $table->softDeletes();
        $table->timestamps();
    });

web.php

Route::post('/work/{id}', 'WorkController@store')->name('work.store');

Exists but does not exist

SQLSTATE[HY000]: General error: 1 table category has no column named project_id (SQL: insert into "category"



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire