break foreach laravel

Solutions on MaxInterview for break foreach laravel by the best coders in the world

showing results for - "break foreach laravel"
Héloïse
05 Jul 2017
1@forelse ($datatabel as $data)
2  <tr>
3  	<td>{{ $loop->iteration }}</td>
4  	<td>{{ $data->name }}</td>
5  	<td>
6  		<button type="button" class="btn btn-primary">edit</button>
7    	@forelse($data->subcategory as $subcategory)
8    		@if($subcategory->category_id == $data->id)
9    			<button type="button" class="btn btn-success" disabled style="cursor: not-allowed;">In Use</button>
10    			@php break; @endphp {{-- put this --}}
11      		@endif
12      	@empty
13        	<button type="button" class="btn btn-danger">delete</button>
14        @endforelse
15	</td>
16  </tr>
17@empty
18  <tr>
19    <td colspan="3" class="text-center">No Data Available</td>
20  </tr>
21@endforelse