0
I’m trying to implement a POST in this method:
public function store(Request $request)
{
$veiculo = new Veiculo($request->(['marca', 'modelo', 'ano', 'preco']));
$veiculo->save();
return $this->respondCreated('The veiculo has been created');
}
I’m thinking he’s in trouble because he’s returning me a 500 error on Postman
{
"marca": "Ford",
"modelo": "Fusio",
"ano": 2014,
"preco": 137.985
}
Seems like a mistake when it comes to parsing the data, what’s on line 30 of your
VeiculosController.php
?– Erlon Charles
he’s saying it’s wrong $vehicle = new vehicle($request->(['brand', 'model', 'year', 'price']); I’ve tried to put it that way, but it’s still giving error: $vehicle = new vehicle($request->all());
– wladyband