I need to create an if with several conditions, there are many examples in the forum but I can't find any that work for me. I need the if to check two conditions, the first verifying if it $user_id
is equal to auth()->user()->id)
if it does not match, I will try the second option, which would be to verify if $privacidad is null in addition to point greater than 100, I hope I have explained myself well.
This is what I'm trying to do but is this syntax correct? "It's just a bad example for you to understand me better"
@if( ( $user_id == auth()->user->id ) or ( $private = null and point >=100 ) )
I tell you that it should be like this
the details
$private = null
you are assigning that the variable is$private
equalnull
, in any case if you want to know if the variable$private
is equal tonull
you must use a double equals symbol==
You should always keep in mind the following:
=
means assignment:$a = 5;
here I say the variable a is equal to 5==
means comparison:$a == $b;
here I compare if the variable$a
has the same value as$b