laravel - How can i check if data is " " -
how can check if data blank not null data == " " still proceeds else statement.
here code :
@if(app\company::all()->first()->logo == " ") <br> @else <img src='.{{ app\company::all()->first()->getlogoattribute()}}' style=" width: 20%;"> @endif
you can use is_null()
, empty()
method:
<?php $logo = app\company::all()->first()->logo; @if(is_null($logo) == false && empty($logo) == true) <br> @else <img src='.{{ app\company::all()->first()->getlogoattribute()}}' style=" width: 20%;"> @endif
Comments
Post a Comment