Skip to content

Twill 2.5.1

Compare
Choose a tag to compare
@ifox ifox released this 02 Sep 14:06
· 699 commits to 2.x since this release

Fixed

  • Twill custom error views and ability to extend its exceptions handler 312b44 c16d2e

Twill uses it's own internal exception handler for controllers extending A17\Twill\Http\Admin\Controller and A17\Twill\Http\Front\Controller, to support unauthenticated requests redirection, custom error views and custom validation error responses.

To be able to render custom exceptions or report them to an external service on a route that is mapped to Twill's controller, it is necessary to disable twill.bind_exception_handler. Your Laravel handler can then extend Twill's internal handler.

The reasoning behind assigning a custom handler to the FrontController is to be able to redirect unauthenticated requests to /admin-preview routes that are registered by the showWithPreview route macro. This is the url showing in the CMS permalink when a record is still a draft. Not many Twill users are leveraging this frontend tooling, but it exists, so wanted to provide the rationale behind all this.

This change is resolving an issue for users that were previously extending the handler for the reasons explained above, as well as making sure custom Twill errors views are automatically in use on the admin routes.