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

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -