Custom error pages
So in the past i used https://v2.filamentphp.com/tricks/custom-laravel-error-pages for my custom error pages and this worked great.
But this doesn't work anymore with V3. I have been trying to get started with several filament components (panel:s:page, panels::layout, etc) but they either need an $this or they are missing Livewire.
Which all make sense but what would be the best approach to create a proper 404 page inside Filament.
Filament
Custom Laravel error pages by Jeff Greco - Tricks - Filament
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
13 Replies
Anyone? 😢
I am doing something different then you are but this is how I do it.
what have you actually tried in your 404.blade.php
resources/views/components/layouts/error.blade.php
resources/views/errors/404.blade.php
Keep in mind in the error template that I use Flare error tracking
Sorry for the late response, had something comming up inbetween.
@awcodes i tried extending the panel but without any success. Main thing i wanna create is a nice user flow. A client doesn't have to be met with an 404 page that looks fastly different than the application. And where it's hard to go back to where they are.
@Proculair thanks a lot for your input, and i think this is kinda my fear that i need to create a seperate template structure for this without the ability to simply intergrate the error pages as Filament pages.
You could also have a look at this: https://filamentphp.com/docs/3.x/support/blade-components/overview
Maybe build your error template using Filament UI blocks.
Yea probably going that route, thanks
@Augus van GIls did you managed to fix the "Using $this when not in object context" error ? Or did you created a separate layout for the error page ? Just upgraded to v3 and couldn't found a good solution yet.
@Corne for now im using separate layouts. I would love to have this integrated in Filament more but i have no clue on how to.
@jgreco Apologies for the tag: I'm taking a wild guess that since it's got your name on it, you probably wrote the article referred to by the OP above, in relation to Filament v2. Have you had a chance to implement Custom Error Pages with a v3 project? If not, that's cool, but if you have and would be willing to share some tips on implementing it for v3, it'd be appreciated!
@DrByte I haven't implemented in v3 yet, but you can most likely accomplish the same using
<x-filament-panels::page.simple>
here's the Blade component for the simple page:
using
<x-filament-panels::page.simple>
triggers Using $this when not in object context
Hmm, the logo... one moment
Unfortunately, I don't see a quick way (like in v2), just yet.
You can copy vendor/filament/filament/resources/views/components/layout/base.blade.php into your own layout file, remove all references to $livewire, then you will be able to use Filament UI components to build out the page