> For the complete documentation index, see [llms.txt](https://ibnnajjaar.gitbook.io/graphify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ibnnajjaar.gitbook.io/graphify/basic-usage/preparing-your-model.md).

# Preparing Your Model

To associate Open Graph Image with a model, the model must implement the following interface and trait:

```php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class YourModel extends Model implements HasGraphify
{
    use GraphifyTrait;
}
```

### Graphify Image URL Field

The package assumes you have a nullable string field named `og_image_url` in your model. If you do not have such field, add the following line to your model migration. If your application is in production, you may need to add this to a modification migration.

```php
 $table->string('og_image_url')->nullable();
```

If your model does have such a field but with a different field name, you may override the default by adding the following method to your model.

```php
public function getOpenGraphImageUrlField(): string
{
    return 'your_custom_open_graph_image_url';
}
```
