Thank you so much! this will be great. 🙂
I already checked Insomia, its great! I can even generate code calling it on my Mobile Project. 😀 thank you so much. I will make an API routes to my Custom Modules, this will be great for testing. So good. Thank you!!! 😀
🙂
UPDATE: I am able to Authenticated Get and Post to my Module API now, thank you very much! Insomia a really great tool. 😀
public function getJournals(Request $request, Journal $journal)
{
try {
$journals = $this->journalService->getJournals();
$journals = (new JournalPresenter())->present($journals)['data'];
return apiResponse($journals);
} catch (\Exception $exception) {
return apiExceptionResponse($exception);
}
}
public function postJournals(Request $request, Journal $journal)
{
try {
$records = json_decode($request->getContent(), true);
DB::table('journals')->insert($records); // Eloquent approach
return apiResponse([], trans('Corals::messages.success.created', ['item' => 'Journal']));
} catch (\Exception $exception) {
return apiExceptionResponse($exception);
}
}
Please login or Register to submit your answer