Skip to content
Discussion options

You must be logged in to vote

The keys for this project are not used under the hood of the Laravel framework.

In turn, Laravel uses a direct translation of phrases such as Not Found or Page Expired.

The HTTP Statuses package allows developers to use these keys themselves in their project.

For example:

namespace App\Exceptions;

class Handler extends BaseHandler
{
    public function register(): void
    {
        $this->registerDefault();
    }

    protected function registerDefault(): void
    {
        $this->renderable(function (Throwable $e) {
            $code = method_exists($e, 'getStatusCode') ? $e->getStatusCode() : $e->getCode();

            return config('app.debug')
                ? $this->response($e->g…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@buddhaCode
Comment options

@andrey-helldar
Comment options

@buddhaCode
Comment options

@andrey-helldar
Comment options

@buddhaCode
Comment options

Answer selected by andrey-helldar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants