Unique Multiple Columns
Hi everyone,
I'm using this code to validate multiple columns, but I'm not sure how to handle the exception.
I'm using this code to validate multiple columns, but I'm not sure how to handle the exception.


Forms\Components\Select::make('warehouse_id')
->relationship('warehouse', 'name')
->searchable()
->preload()
->required()
->live(),
Forms\Components\Select::make('product_id')
->relationship('product', 'name')
->searchable()
->preload()
->required()
->unique(ignoreRecord: true, modifyRuleUsing: function (Unique $rule, Get $get) {
return $rule
->where('warehouse_id', $get('warehouse_id'));
}),