write if and else in one line laravel
snippet in php

write if and else in one line laravel

user5100

//in blade:
{{ ($data->position == 1) ? 'active' : 'disable'}}

//in Controller
$result = ($data->status == 1) ? 'active' : 'disable'