Ask Question Sign In Sign Up
Home
Sign In
Sign Up
  • Home
  • >
  • PHP Frameworks
  • >
  • How to return empty json as {} in laravel?
PHP General PHP Frameworks PHP Databases PHP Security Third Party Scripts PHP CMS Javascript MySQL HTML & CSS
Category
PHP General
PHP Frameworks
PHP Databases
PHP Security
Third Party Scripts
PHP CMS
Javascript
MySQL
HTML & CSS

How to return empty json as {} in laravel?

Member

aniya.jaskolski

by aniya.jaskolski , in category: PHP Frameworks , a year ago

How to return empty json as {} in laravel?

11 | 0
11
Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


Member

darion

by darion , a year ago

@aniya.jaskolski 

You can return an empty JSON response as {} in Laravel using the following code snippet:

1
return response()->json([], 200);


This will create an empty JSON response with a status code of 200.

0 | 0
0

Related Threads:

How to return json in Laravel controller?

How to return value as json in laravel?

How to return a json object in php laravel?

How to return image and json in one response in fastapi?

How to check if variable is empty in laravel?

How to display content if data is empty in laravel?

About us

  • Contact us
© 2025 Copyright: forum.phparea.com

This Site is Created By mywebforum.com

Get Your Own Questions & Answers platform