Nova disable attach on Belongs to Many
Hello , i have rescorce having many to many with another model how could i disable editing on it
just view relation with out attach or detach it
i define the polices and the relation but nothing change i try to non display view icon and it's work but the attach did not work
How do you hide the attach action? Show your policy. How can I help you with little information?
@bobbybouwmann
well i have Order model and Theme model they are many to many
this is Order policy
public function attachTheme(Order $order, Theme $theme)
{
return false;
}
and this is Theme policy
public function attachOrder(Order $order,Theme $theme)
{
return false;
}
and this is the relation in Order model
public function Themes()
{
return $this->belongsToMany(Theme::class);
}
This looks correct... This should work fine indeed
@bobbybouwmann
Thank you , yes it works ,
one of these policies was having before method with override these things
@hala Aah yeah, before can be dangerous in this case ;) Glad you resolved it.
Please or to participate in this conversation.