From 26f8595f576fbeef85eb18c6818e12993ab3f103 Mon Sep 17 00:00:00 2001 From: Senexis Date: Sat, 9 Nov 2024 12:08:35 +0100 Subject: [PATCH] Update the Model Menu Panel example to include the trait for a more complete reference. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ccc45c7..e5ff9d2 100644 --- a/README.md +++ b/README.md @@ -185,14 +185,17 @@ The model menu panel allows you to add menu items from a model. To create a model menu panel, your model must implement the `\Datlechin\FilamentMenuBuilder\Contracts\MenuPanelable` interface and `\Datlechin\FilamentMenuBuilder\Concerns\HasMenuPanel` trait. -Then you will need to implement the following methods: +Then you must also implement the `getMenuPanelTitleColumn` and `getMenuPanelUrlUsing` methods. A complete example of this implementation is as follows: ```php -use Illuminate\Database\Eloquent\Model; +use Datlechin\FilamentMenuBuilder\Concerns\HasMenuPanel; use Datlechin\FilamentMenuBuilder\Contracts\MenuPanelable; +use Illuminate\Database\Eloquent\Model; class Category extends Model implements MenuPanelable { + use HasMenuPanel; + public function getMenuPanelTitleColumn(): string { return 'name';