Honeystone / laravel-seo

An SEO configuration library for Laravel applications.
https://honeystone.com
MIT License
248 stars 6 forks source link

favicon creation process #2

Closed HakanKorkz closed 1 month ago

HakanKorkz commented 2 months ago

Hello friends

In the documentation of the package, I could not fully understand how the favicon definition / creation process is performed, unfortunately, I wonder if there is a directive, a project example on how to do it.

PiranhaGeorge commented 2 months ago

Hey,

I'll look at improving the documentation.

To generate favicons using the default config, you just need an image and api key.

You can request an api key here https://realfavicongenerator.net/api/#register_key

Place the image somewhere (doesn't matter where, root is fine) in your project and then run the command:

php artisan seo:generate-favicons

You will be asked for your api key and the for the path to the image (relative to the project root).

The favicons will then be generated and downloaded to the public/favicons directory. The metadata will automatically include the favicon tags.

Other that that, all the documentation to customise the favicons further is on the realfavicongenerator.net website. There are comments in the config pointing you there.

Please let me know how you get on.

HakanKorkz commented 2 months ago

Thank you very much for the return.

Yes, I requested api from the link you gave from the link you gave this day, unfortunately, some kind of mail did not come and I have another question in addition, the favicon change takes place in the administration panel of the person who will use the project, is this not a problem? Is it necessary to do php artisan seo:generate-favicons every time?

PiranhaGeorge commented 2 months ago

If you're having trouble obtaining an api key, you'll need to contact realfavicongenerator.net. We're not associated with them in any way, we just integrate their api.

With regards the command, no, you don't have to use it to generate favicons. You can do it programmatically like this:

seo()->faviconFetch($key, $image);
HakanKorkz commented 2 months ago

I think realfavicongenerator.net has undergone a major change as far as I understand from the warning in the image, I wonder if the project package is compatible with this major change, the api gives an error as seen in the second image, and I don't know exactly what I should do.

Ekran görüntüsü 2024-09-05 154426

Ekran görüntüsü 2024-09-05 154758

PiranhaGeorge commented 2 months ago

Hi,

The package is still compatible with the current API. The new API is not available for non-interactive generation yet.

The error message suggests your API key is invalid. Place it in the configuration files and make sure that there are no spaces and it should work. If it doesn't, the key may need refreshing.

HakanKorkz commented 1 month ago

I think the api for non-interactive is unfortunately not produced or I can't do it 😢😢