owenvoke / blade-fontawesome

A package to easily make use of Font Awesome in your Laravel Blade views.
https://packagist.org/packages/owenvoke/blade-fontawesome
MIT License
167 stars 28 forks source link

Font-Awesome v6 #30

Closed Gummibeer closed 3 years ago

Gummibeer commented 3 years ago

Thanks for thinking ahead @owenvoke ! 🙏 The package already works with Font-Awesome v6. The new thin set as well as all the new icons are detected by the package. As soon as FA6 is out of alpha/beta the packed-in icons could be replaced but you can already use the FA6 Pro icons with the sync pro icons command. 🎉

Right now you can only sync the pro icons with the command as it has hardcoded fontawesome-pro in it. https://github.com/owenvoke/blade-fontawesome/blob/60c1f2b6629012ab4c9e6871dc911c08606d0b27/src/Commands/SyncProIconsCommand.php#L23-L25

Would it be an idea to allow to customize that one as well so that this command could be used to sync the free FA6 icons as well? 🤔

owenvoke commented 3 years ago

I think this is a great idea 👍🏻 If you'd like to open a PR, that'd be very welcome. If not, I'm happy to implement this. Was thinking of having a --free flag, that would just switch it to use @fortawesome/fontawesome-free, unless you want it to be fully customisable (such as with a --package-name {name} option)? 🤔

The only weird thing is that the command name now seems a little odd, do you know if you can do aliases with Laravel commands?

Gummibeer commented 3 years ago

We could do a Artisan::call() from the old one. 😂 But I think that there isn't something like Route::redirect() for commands. 🤔 Should I rename the command to php artisan blade-fontawesome:sync and by default it would do a directory exists check and take the first available. Or you define --pro or --free flags to define the iconset you want to use!?

I wouldn't make it fully customizable as I see no sense to use this package to publish Heroicons for example.^^ I will send in a PR. 🎉

owenvoke commented 3 years ago

Yeah. 👍🏻 I knew there were aliases in Symfony Console, didn't know if that could be done in Laravel but I can't find anything about it.

I think it'd be good to have pro fonts be the default, but have both a --pro and --free flag for consistency. I'd probably rename the command too, just a shame that's kind of a breaking change. 😕

Gummibeer commented 3 years ago

Checked the docs and the Symfony setAliases() works the same in Laravel - so not a breaking change. 🥳

protected function configure(): void
{
    $this->setAliases(['old']);
}

https://symfony.com/blog/new-in-symfony-3-2-console-improvements-part-1

owenvoke commented 3 years ago

Well, that would be great!