Route model Binding
I have different models, where I have a
On the front end, I only want to show "published" models (aka
The problem is, that this logic obviously also kicks in in admin panel, so I get a 404 on "unpublished" resources.
Any elegent solutions for this? For example, can I exclude somehow the admin from my
published_at date as a field and I have different routes, where I use these models with route bindings.On the front end, I only want to show "published" models (aka
published_at > now()). This is easily done by adding the following to the models:The problem is, that this logic obviously also kicks in in admin panel, so I get a 404 on "unpublished" resources.
Any elegent solutions for this? For example, can I exclude somehow the admin from my
resolveRouteBindingQuery logic?