Syntax :
//https://www.pakainfo.com/laravel-6-switch-case-statements
@switch($variable)
@case(value)
// Implementation goes here
break;
@endcase
@default_case
@endcase
@endswitch
Example
@switch($action_input)
@case(1)
<span> `Your Primary Email Address` input is empty! </span>
@break
@case(2)
<span>`Your Password` input is empty! </span>
@break
@default
<span>Sorry, Something went wrong, please try again </span>
@endswitch
using IF ELSE (use if else approach.)
@if(!isset($wp_type))
<b>All</b>
@else
{{ HTML::linkRoute('audit.assign.form', 'All', array($audit_start_month, $mode)) }}
@endif
@if($wp_type == 'M')
-- <b>Maintenance</b>
@else
-- {{ HTML::linkRoute('audit.assign.form', 'Maintenance', array($audit_start_month, $mode, 'M')) }}
@endif
@if($wp_type == 'F')
-- <b>Field</b>
@else
-- {{ HTML::linkRoute('audit.assign.form', 'Field', array($audit_start_month, $mode, 'F')) }}
@endif
@if($wp_type == 'D')
-- <b>Drilling</b>
@else
-- {{ HTML::linkRoute('audit.assign.form', 'Drilling', array($audit_start_month, $mode, 'D')) }}
@endiflarta
facing solution : https://www.pakainfo.com/laravel-6-switch-case-statements
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community