I'm a newbie to this laravel.
i've followed a tutorial and i've checked that i wasn't do anything wrong, and then this error comes up. in this code i tried to Read data from table Inputs and create a page to Insert Data into the database in Inputs table.
TicketController:
public function index(){
$inputs = Inputs::all();
return view('index', [
'inputs' => $inputs
]);
}
public function create(){
return view('create');
}
public function store(Request $request)
{
$inputs = new Inputs();
$inputs->inputName = $request->inputName;
$inputs->inputAddress = $request->inputAddress;
$inputs->inputBDO = Carbon::parse($request->inputBDO);
$inputs->inputEmail = $request->inputEmail;
$inputs->inputPhone = $request->inputPhone;
$inputs->inputJob = $request->inputJob;
$inputs->save();
return redirect('/input');
}
}
Routes:
Route::get('/', 'TicketController@index');
Route::get('/input/create', 'TicketController@create');
Route::post('/input', 'TicketController@store');
Aucun commentaire:
Enregistrer un commentaire