How can I use switch in blade templates? When I used:
@switch($login_error)
@case(1)
`E-mail` input is empty!
@break
@case(2)
`Pa
To overcome the space in 'switch ()', you can use code :
Blade::extend(function($value, $compiler){
$value = preg_replace('/(\s*)@switch[ ]*\((.*)\)(?=\s)/', '$1', $value);
$value = preg_replace('/(\s*)@case[ ]*\((.*)\)(?=\s)/', '$1case $2: ?>', $value);
$value = preg_replace('/(?<=\s)@default(?=\s)/', 'default: ?>', $value);
$value = preg_replace('/(?<=\s)@breakswitch(?=\s)/', '