Laravel setStatusCode Argument must be of type int, string given called Response

Created At: 2023-07-19 07:25:30 Updated At: 2023-07-19 07:33:55

Symfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string

The above error may happen for many reasons. One of the reason is that your server .env file has wrong configuration.

The configuration could be about wrong

1.APP_URL set up

2. Database set up or wrong name

3. Wrong database password

For me it was the wrong database name and also the wrong APP_URL set up. I set them correctly and the error gone.

 

Comment

Add Reviews