category_id.blade.php
464 Bytes
@if ($items->where('parent_id', $parent)->count())
@php $level++ @endphp
@foreach ($items->where('parent_id', $parent) as $item)
<option value="{{ $item->id }}" @if ($item->id == $parent_id) selected @endif>
@if ($level) {!! str_repeat(' ', $level) !!} @endif
{{ $item->name }}
</option>
@include('admin.part.category_id', ['level' => $level, 'parent' => $item->id])
@endforeach
@endif