Control Statement
if else statement

If statement is use to check condition, if Condition is true then body of the if block will be executive otherwise else part will be executed.

@php
$num = 5
@endphp
@if($num>0)
{{$num}}
@else
sharma
@endif

while loop

while is use to repeat statement many time untill the condition will be fullfil

@php
$i = 1
@endphp
@while ($i<=5)
{{$i++}}
@endwhile

for loop

for is use to repeat statement many time untill the condition will be fullfil

@for ($i = 1; $i <= 5; $i++)
Demo Text
@endfor


Previous
Next