Laravel blade “old input or default variable”?

or is a comparison operator in PHP, so your code is evaluating to true, or 1. What you want is a ternary if statement.

As mentioned, or can be used in blade as shorthand for a ternary if statement.

But you can (and should) just pass the default value as the second argument to the function, like so:

value="{{ old('salary_' . $employee->id, 'Default') }}"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)