Even after setting the route, when performing a post, the application occurs the "404 not foud" error. However, when accessing the index, I get data from my bank. Theoretically, it was also not to access.
I'll post the code for you to review
Route::get('/personal', 'PersonalController@index');
Route::post('/personal/new', 'PersonalController@store');
Route::get('/personal/remove/{id}', 'PersonalController@destroy');
My controller:
public function store(PersonalRequest $request){
$this->validate($request, [
'cpf' => 'required|cpf',
]);
$user = new Personal;
$user->nome_pessoal = $request-> nome_pessoal;
$user->dt_nascimento = $request-> dt_nascimento;
$user->cidade = $request-> cidade;
$user->rg = $request-> rg;
$user->nome_pai = $request-> nome_pai;
$user->nome_mae = $request-> nome_mae;
$user->cpf = $request-> cpf;
$user->log_registro = date('Y-m-d H:i:s'); // salvando bd: ano/mes/dia
if(!$user) {
return error_log('');
} else {
$user->save();
return ('Page has been added.');
}
}
Image of error when testing the API in postman