i have a bug with my laravel project when i try to insert a new object in a table
SQLSTATE[42703]: Undefined column: 7 ERROR: column "id" does not exist LINE 1: ... "theme") values ($1, $2, $3, $4, $5, $6, $7) returning "id" ^ (SQL: insert into "proverbe_jour" ("id_proverbe", "date", "proverbe", "signification", "ethnie", "pays", "theme") values (62, 2017-06-11 01:05:31, Couvert aux épaules mais nu aux hanches., Qui tape sur un panier couvert de suie reçoit la suie sur sa tête., Basonge, Congo, Bon sens) returning "id")
This is my controller
<?php
namespace App\Http\Controllers;
use App\jour;
use App\Proverbe;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function rien(){
return view('welcome');
}
public function jour($id){
$proverbe = Proverbe::where('id' , '=' ,$id)->first();
$proverbedujour = new jour();
$proverbedujour->id_proverbe = $id;
$date = new \DateTime(null);
$proverbedujour->date = $date;
$proverbedujour->proverbe =$proverbe->proverbe;
$proverbedujour->signification =$proverbe->signification;
$proverbedujour->ethnie =$proverbe->ethnie;
$proverbedujour->pays =$proverbe->pays;
$proverbedujour->theme =$proverbe->theme;
$proverbedujour->save();
}
public function listproverbe(){
$proverbes = Proverbe::paginate(10);
return view('listproverbe')->with('proverbes' , $proverbes);
}
public function valide(Request $request){
$parameters = $request->except('_token');
if(isset($parameters['proverbe']) && isset($parameters['signification']) && isset($parameters['theme']) && isset($parameters['pays'])){
Proverbe::create($parameters);
return redirect()->Route('home')->with('success',' proverb well added ');
}else {
return redirect()->Route('home')->with('error','Please complete all the fields');
}
}
}