afsakar / filament-otp-login

OTP Login for FilamentPHP
https://filamentphp.com/plugins/afsakar-otp-login
MIT License
42 stars 11 forks source link

[Question/feature]: Override some of the login page methods #11

Closed dreftas closed 2 months ago

dreftas commented 2 months ago

What happened?

Panel configuration ->login(MyCustomLogin::class) method doesn't work when using this plugin, because plugin itself registers ->login() to use it's own class which extends that base Filament\Pages\Auth\Login page.

Because of this, I can't override for example login page public function getHeading(): string | Htmlable function to set different heading for my panel login page.

Is there any way to workaround this ? (Replacing __('filament-panels::pages/auth/login.heading') translation is not the way, because I want to use different headings for different panels)

How to reproduce the bug

Set panel ->login() to some custom page and there won't be any changes, it still shows default login page.

Package Version

1.3.4

PHP Version

8.3

Laravel Version

11

Which operating systems does with happen with?

No response

Notes

No response

SNWCreations commented 2 months ago

DO NOT BELIEVE MY DELETED COMMENT PLS MY ACCOUNT GOT HACKED IM CONTACTING GITHUB SUPPORT SORRY FOR MY FAULT :(

afsakar commented 2 months ago

Hey, thank you notice this. I will look what can i do, maybe i can add some method for overriding base Otp Login Page. 👍

afsakar commented 2 months ago

You can add custom page for every panel. See the doc.

https://github.com/afsakar/filament-otp-login?tab=readme-ov-file#custom-login-page