Auth in Edge for Models


#1

Hi,

How can I use @if(auth…) for other models/DB/ than user?

Example: @if(auth.order.isPaid)


#2

auth stands for authentication, meaning it only applies to users to check whether they are logged in or not - and some other bits and bobs. I am sure it can be done by linking user and order models e.g. auth.user.order.isPaid, but I fail to see the point in that.

If you are trying to get true or false on order.isPaid for authenticated user you are trying to do this in wrong way.

In your controller get the authenticated user and search for order(s) done by that user and pass it to the view.