**1st code: **
<div class="card-header">
{{ isset($categories) ? 'Edit Category' : 'Create Category'}}
</div>
2cd code :
<label for="name">Name-->{{ isset($categories) ? $categories->Name : ''}}</label>
im working on a categories table in laravel. the problem is when im creating a new category the 1st code goes -> 'Create Category', and the 2nd code goes : ' ' which it super good ! BUT when im editing a category the 1st code goes : 'edit category' and the 2nd code goes : '' instead of the value of $categories->name value . Can any one help !?
I think you should use !empty($categories)
, this may solve your problem.
ISSET checks the variable to see if it has been set. In other words, it checks to see if the variable is any value except NULL or not assigned a value, which means it will return true even if it's "".
EMPTY checks to see if a variable is empty. in your case "" will be considered as empty.
For more info check