Hello, thanks for checking out here!
Here is the quick and short answer with the examples:
<img src="@if($category->image) {{ ($category->image) }} @else {{'https://via.placeholder.com/50'}} @endif" alt="{{ $category->name}}" width="50" height="50" />
This is what I was looking for my part of development laravel! same you can achieve for the html blocks: here is the example:
@if ($message = Session::get('success'))
<script>
if(window.toastr)
toastr["success"]("{{ session()->get('success') }}");
</script>
@endif
@if ($message = Session::get('success'))
<div class="alert alert-success">
session()->get('success')
</div>
@endif
To use elseif just use following syntax @elseif(condition) along your code or between.
Thanks & Happy learning Laravel!
In today’s fast-paced work environment, meetings are essential but can often feel unproductive. However, by…
Gold is one of the most coveted precious metals in the world, adored for its…
Gold, the shimmering metal synonymous with wealth, power, and beauty, has been deeply intertwined with…
How to Onboard an Intern in a Small, Individual-Based Company Hiring an intern can be…