The primary method of generating images is using the generate-images
Artisan command:
1php artisan social-media-image-kit:generate-images
This command will generate images for each collection that has been configured. During the process, you should see something similar to the following image in your terminal:
By default Social Media Image Kit will not regenerate images that were previously generated when running the generate-images
command. To force a regeneration we can use the --regen
flag:
1php artisan social-media-image-kit:generate-images --regen
To regenerate images for a single entry using the command line we can pass the ID of the entry as the first argument to the generate-images
command:
1php artisan social-media-image-kit:generate-images the-id-here --regen
--collection
OptionThe generate-images
command supports a --collection
option that may be useful if you need to run the command from another command or other automation script. When this option is set it will not prompt for any input.
To process images for all collections you may use the *
value:
1php artisan social-media-image-kit:generate-images --collection=*
You may also specify a single collection name like so:
1php artisan social-media-image-kit:generate-images --collection=blog
If you'd like to specify multiple collection names, separate them with commas:
1php artisan social-media-image-kit:generate-images --collection=blog,pages
You may use a queue to generate images automatically whenever a content editor makes changes to an entry within the Control Panel. For more information on how to set this up, please consider checking out the Using a Job Queue article.
The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.