Missing files running php artisan vendor:publish --tag="filament-views" on filament v3
Hello there,
I just started a new laravel project and installed filament v3 according the documentation and I want to override the login view so that it only has a button to login via Socialite.
After running the command
php artisan vendor:publish --tag="filament-views"
It generates a bunch of folders and blade files but no views like login.blade.php for example...
filament v3.0-stable
Laravel v10.17.1
Is it a bug?
Many thanks34 Replies
Hi @coolmanpt , were you ever able to find a solution for this? I'm trying to do the same thing.
Hey! nope I didn't I just stayed in V2.
π
@Filament I'm guessing it's by design, but in V3 we are no longer able to publish the login page views so we can edit. Is there an "official" way to add things like Socialite links as a login method?
you can still copy the views out of vendor folder π
but for auth pages you shouldn't need to. you can create your own view and Login Class and pass it to the ->login() method on your panel
you could even extend Filament's Login Class
Ah.. I've seen some mention of that when researching so I'll continue down that path. Thanks for the quick response!
@coolmanpt - Once I get this working I'll let you know what I did.. maybe that would bring V3 back into play for you.
For example, not your full use case, but I do this for local dev so I don't have to fill the form every time:
So doing something similar you can also tell it to render a different view
Oh, I see I thought the login() was only to enable login in the panel. Gotta check it out
or you can do you're own Login class without extending Filament's, just depends on what level of functionality you need it to handle.
Technically, yes, but it expects an override.
The other auth routes all work the same way too, ->register(), ->verifyEmail(), etc
Gotcha, my goal with is is to make a boilerplate for my company internal projects, since we use Azure as our email system and such we just need the Socialite provider to work
But I'll check that soon and report here
Should be doable
just to make the example complete. π
and it can be a simple page created by the filament create page command and just extend it?
i don't think there's a command for that.
the auth pages use the simple layout, since the other pages require a logged in user
php artisan make:filament-page Settings I mean this one
Replace Settings with CustomLogin for example
yea, pretty sure those commands only generate 'panel' pages
no, the login class is not a page
it is a livewire component that is on the page
here's what the login blade view looks like
if you look in the
vendor/filament/filament/resources/views/pages/auth
you'll see all the views.
you can copy them to your app and do what you need to do with themYeah I'm checking the repo now and found it. So I need to create a livewire component, extend it and call it on the login method
1. Create
CustomLogin
class and either extend Login
or don't
2. Set the $view
property in CustomLogin
to reference your blade file
3. Copy over this code into your blade file
4. Add additional functionality to the class and the view per your needs
5. Add ->login(CustomLogin::class)
π«‘
I'll try it, and if it works I'll leave a message here and mark it as the solution so that the issue closes
by using this component
<x-filament-panels::page.simple>
you are extending the livewire component. so no need to actually make one, unless you are using your own whole page template.In terms of just pointing to a different view, it worked like a charm.. Going to post what I did for the quick mockup.. What are the tags again for code snippets? βΊοΈ
3 -> `
3 back ticks
and the language to highlight it
First, I created a simple PHP class and had it extend the Filament login class. Then I overrode the view string:
Then in the AdminPanelProvider, I just passed that new custom Login class to the method
Of course, in this case I would copy the Filament login view, since I want all of it just with the addition of a button for Google (or whichever OAuth provider)
depending on where you want those buttons could just render them into one of the renderhooks on that page and not have to override the entire view. π
I think it nails it I guess
Even better
Thanks for the help! I really appreciate it
i'm sure the render hooks render outside the box on the page though. that's why i bring it up
I guess we solved this. Many thanks π
You're not getting out of v3 that easy. It's too good not to use it. π
Early adopter till I die!
Cheers and good luck on the projects
Thanks again
Thanks and likewise ππ»
Remember to delete those views you published.
And just to close the loop, I tried using the render hook as well by simply chaining it to my panel in the AdminPanelProvider: