How to place spaces properly in nested dropdown in blade template Laravel
<p>I am new to laravel. I recently started doing some basic things with Laravel and i really like it. I am trying to create nested dropdown like this:</p>

<p><a href="https://i.stack.imgur.com/qqoRj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qqoRj.png" alt="enter image description here"></a></p>

<p>From this dropdown list i will be selecting one. </p>

<p>I have my array like this: </p>

<p><a href="https://i.stack.imgur.com/JAfuI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JAfuI.png" alt="enter image description here"></a></p>

<p>And now my VIEW template look like below code, where i have used recursive method. </p>

<pre><code>&lt;select class="form-control select2me" name="service_id"&gt;
        &lt;option value=""&gt;Select...&lt;/option&gt;
        @foreach($serviceslist as $serviceli)
             @include('services.categorydropdown', array('serviceli'=&gt; $serviceli))
        @endforeach
&lt;/select&gt;
</code></pre>

<p>Another template <code>services.categorydropdown</code>:</p>

<pre><code>&lt;option value="{{$serviceli['id']}}"&gt;
    @for ($i = 0; $i &lt;= $serviceli['service_id']; $i++)
        @if($serviceli['service_id'] != 0)
        &amp;nbsp; &lt;!-- ------------I want to add Space as the nested level goes by ------------- --&gt;
        @endif
    @endfor
    {{$serviceli['servicename']}}
&lt;/option&gt;

@if(count($serviceli['allChildrenCategory']) &gt; 0)
    @foreach($serviceli['allChildrenCategory'] as $serviceli)
        @include('services.categorydropdown', $serviceli)
    @endforeach
@endif
</code></pre>

<p><strong>Please suggest how can i create the space (<code>&amp;nbsp;</code>) as the array level get nested.</strong> </p>

<p>Thank you!</p>

<p>Thank you for your help. After your suggestion @nakashu here is how it looks now.
<a href="https://i.stack.imgur.com/yBHTx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yBHTx.png" alt="enter image description here"></a>
In last node we are going wrong somewhere.</p>