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

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -