filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.12k stars 2.95k forks source link

Accessing page from custom url ignored panelConfigurations #8702

Closed valpuia closed 1 year ago

valpuia commented 1 year ago

Package

filament/filament

Package Version

3.0.60

Laravel Version

10.24

Livewire Version

3.0.5

PHP Version

8.2

Problem description

While using panel for landing page and provide render-hook for some customization. If you access pages from custom url then the render hook is gone. but if you access using filament auto-generated url then it's displaying correctly.

While investigating further, inside page from custom url then the primary color is also change, I think whatever configuration we create inside panelProviders is ignored

Inside dashboard (filament-url), primary color is violet. Screenshot from 2023-09-25 10-30-40

But, inside custom-url, I just change the location, not others. The primary color is reverted to default primary (Ember(?)) Screenshot from 2023-09-25 10-30-49

Expected behavior

Use panel configuration while accessing from custom url also

Steps to reproduce

  1. Check readme file for installation
  2. In landing page (notice the render-hook, theme-switcher on right side) navigate between pages from navbar, and click "inside-page" custom-url in Dashboard to show another pages, and also button with primary color (RED)
  3. Inside 'page' from custom url, notice that the render-hook is gone (right side) and button also change to default

How to show this only happen in custom url

  1. Remove custom url from web.php
  2. Play along in dashboard

Reproduction repository

https://github.com/valpuia/render-hook-bug

Relevant log output

No response

Donate 💰 to fund this issue

Fund with Polar

zepfietje commented 1 year ago

I'm not sure what you're trying to achieve exactly, but it seems like you should just register the route on the panel provider instead?

valpuia commented 1 year ago

I'm not sure what you're trying to achieve exactly, but it seems like you should just register the route on the panel provider instead?

Yes, you're correct, after registering inside panel routes everything is working perfectly. Thank you

runzway commented 1 year ago

I'm not sure what you're trying to achieve exactly, but it seems like you should just register the route on the panel provider instead?

Yes, you're correct, after registering inside panel routes everything is working perfectly. Thank you

how did you registered the page route inside panel?

valpuia604 commented 1 year ago

how did you registered the page route inside panel?

I've registered like below.. (this is still me (the author) but using company github ac)

return $panel
    ->routes(function () {
        return [
            Route::get('abc', \App\Filament\App\Pages\Abc::class)->name('abc'),
            Route::get('...', ....),
        ];
    })
runzway commented 1 year ago

thanks! ;)