0
I have the code below to create a report:
$this->repository->create($request->all());
return response()->json(['sucesso' => 'Relatorio cadastrado com sucesso.']);
How do I get the registry ID created and send together in response?
0
I have the code below to create a report:
$this->repository->create($request->all());
return response()->json(['sucesso' => 'Relatorio cadastrado com sucesso.']);
How do I get the registry ID created and send together in response?
2
Store the object in a variable, in this case the $new
, try the following:
$new = $this->repository->create($request->all());
return response()->json(['sucesso' => 'Relatorio cadastrado com sucesso. ID: ' .$new->id]);
Browser other questions tagged php laravel laravel-5
You are not signed in. Login or sign up in order to post.
Perfect @Miguel thanks! (I will wait the minimum time to mark as correct)
– Raylan Soares
You’re welcome @Raylansoares, I’m glad you solved
– Miguel