I have generated error pages using Laravel's php artisan vendor:publish --tag=laravel-errors command.
Now inside, let's say 404.blade.php view, I want to get the status code of 404 and use it for a simple if-else case but I don't want to include any tag around and later getting the variable, so I tried below
http_response_code() and app('Illuminate\Http\Response')->status()
But ironically, both sometimes return 200 as the http response code while I'm expecting to get 404.
What's the problem?