Hello I have the following class
namespace App\Repository\Constants\Models;
class InstanceModelContant
{
const ALREADY_DEMO = "Usted ya posee un demo.";
const ALREADY_INSTANCE = "Ya tiene un servidor con estas caracteristicas.";
const INSTANCE_DEMO_TYPE = "t2.micro";
const CHAR_NOT_PUBLIC_ADDRESS = "--";
}
Within the class I have defined several constants that I use in various places throughout the project.
in blade I have to make a comparison of the attribute of a model that would look like this
@if($instancia->publicip == '--')
{{$instancia->publicip}}
@else
<h1>hola mundo</h1>
@endif
But as you can see, I had to burn the code -- what I want is to use the CHAR_NOT_PUBLIC_ADDRESS attribute inside blade and not burn the code.
Or what else could you advise me?
It is not as complicated as you imagine, you can even display the text extracted from one of your constants and not only use it in your condition.
I hope you were able to solve. Cheers