How to show error or success message in api.

  • Neel Bhardwaj

  • 07-Feb-2022


  • 154

For error :

return response()->json([
    'message' => 'Some error message.'

For success :

return response()->json([
    'message' => 'Some success message.'

"Programming isn't about what you know,
it's about what you can figure out.”
Chris Pine

Neel Bhardwaj

A full stack developer. I have a Passion for Creating Clean, Beautiful, Interactive, Minimalistic, Responsive and User Friendly website, Developed by Modular, Scalable and Functional Code.

Recent comments

Leave a reply

Fatal error: Cannot declare class Connection, because the name is already in use in /home/d8ouyzxnuef4/public_html/ on line 3