Dynamic Logo Generation - samuelgrant/fight-for-kidz GitHub Wiki

Dynamic Logo

Using the stil/gd-text PHP library, the websites back end will draw the appropriate year onto the Fight For Kidz logo.

The logo will be recreated every time an event's public visibility is turned on or off. Because the image itself is being manipulated, it can easily be copied for use off-site, should the clients desire.

Setup

  • All image and font assets are tracked on git, so you do not need to manually place any files.
  • You will need to make sure that the stil/gd-text library has been installed with composer. Run composer install if you are not sure.

Code Location

The code for this feature is contained in the EventsManagementController class. The method updateLogo retrieves the current event, and then copies the blank logo, adds the current event's year to the logo, and then places the processed images into /storage/app/public/images/f4k_logo.png.

The above method should be called whenever the current event may change. Currently, it is called whenever the event->togglePublic() method is called.