How to ensure that a relation in a relation manager has at least one entry ?

App:
Laravel 12
Filament v3

I got these models :
  • order
  • orderlines
order hasMany orderlines
orderlines belongsTo order


on the OrderResource I got a relation manager.

When an order is updated (only) I'd like to check if at least one orderlines belongsto order. If not, i'd like to display a modal that halts the process.

I checked the documentation regarding lifecycle hooks butI don't get where to place this logic.

How would I proceed ?

Thx !!
Was this page helpful?