Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel blade conditional class

@php
    $isActive = false;
    $hasError = true;
@endphp
 
<span @class([
    'p-4',
    'font-bold' => $isActive,
    'text-gray-500' => ! $isActive,
    'bg-red' => $hasError,
])></span>
 
<span class="p-4 text-gray-500 bg-red"></span>
Comment

PREVIOUS NEXT
Code Example
Php :: php foreach count rows 
Php :: remove last character from string in php 
Php :: php undefined function split 
Php :: php explode multiple delimiters 
Php :: wordpress require file from plugins folder 
Php :: validation not exists with this id laravel 
Php :: how to use wherein in json array laravel 
Php :: To find out where your php.ini is located 
Php :: php redirect 404 page not found 
Php :: PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) 
Php :: laravel foreach loop index from 1 
Php :: laravel blade form old value 
Php :: convert array to string laravel 
Php :: laravel hasmany count 
Php :: laravel pagination with get parameters 
Php :: How to format a json response in php 
Php :: php remove last newline from string 
Php :: php set timezone 
Php :: 15000 tl to usd 
Php :: how validate array in laravel in request 
Php :: load database in codeigniter 
Php :: laravel wher in 
Php :: php eliminar elementos vacios array 
Php :: php stop execution 
Php :: --prefer-dist what is use in laravel 
Php :: laravel log could not be opened fix 
Php :: how to get a whole number from decimal in php 
Php :: php string underscore into camelcase 
Php :: str_contains 
Php :: create a modal livewire laravel 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =