Graphify
  • Installation
  • Requirements
  • Basic Usage
    • Preparing Your Model
    • Creating And Retrieving Open Graph Images
  • Advanced Usage
    • Customizations
    • Auto Triggering OG Image Update
    • Controlling Save Process
Powered by GitBook
On this page
  1. Advanced Usage

Auto Triggering OG Image Update

There are times you need to update something that will directly effect the generated open graph image. For an example you have a post where you are adding the post title to the OG image. When the title gets updated, you will want the OG image to be updated as well. To automatically trigger the update of OG images on such occasions, you may add a property to your model as below.

protected array $graphify_fields = [
    'title',
];

This will auto update the OG image when the title of the model is updated.

PreviousCustomizationsNextControlling Save Process

Last updated 2 years ago