Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel $loop->iteration

{{$loop->iteration}} 
Comment

laravel foreach iteration

@foreach($listdata as $data)
	// normal iteration
		{{ $data->iteration() }}

	// if you using "paginate()" in your query, better use this iteration per-page below:
		// for example:
			// page 1 iteration = 1,2,3,4,5 ascending, 5,4,3,2,1 descending
			// and page 2 iteration will be = 6,7,8,9,10 ascending, 10,9,8,7,6 descending

        // iteration ascending (1,2,3,...)
            {{ $data->firstItem() + $loop->index }}

        // iteration descending (...,3,2,1)
            {{ ($data->total()-$loop->index) - (($data->currentpage()-1) * $data->perpage()) }}
@endforeach
Comment

laravel loop iteration

$loop->iteration < 9 ? '0' . $loop->iteration : $loop->iteration
Comment

loop iteration laravel

{{$loop->iteration < 10 ? '0'.$loop->iteration : $loop->iteration}}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel collection transform 
Php :: php scandir 
Php :: php foreach random 
Php :: get data from select option php 
Php :: how get the Photo size upload in laravel 
Php :: use php variable in html attributes 
Php :: php var_export to string 
Php :: php begin 
Php :: php datetime sub minutes 
Php :: php if $_post 
Php :: Line : 83 -- syntax error, unexpected end of file php 
Php :: if i am using $_SERVER it shows 500 error 
Php :: Laravel retrieving single record 
Php :: laravel change foreign key name 
Php :: how to check php version codeigniter 3 
Php :: array_diff 
Php :: php cut string 
Php :: laravel check if record exists 
Php :: Fatal error: Allowed memory size of 1610612736 bytes exhausted but already allocated 1.75G 
Php :: redirect compact laravel 
Php :: string convert snake case to title case in laravel 
Php :: stripslashes in php 
Php :: PHP validation/regex for URL 
Php :: wp tax_query in 
Php :: prettier with php 
Php :: hide env file in laravel 
Php :: delete model laravel 
Php :: phpspreadsheet set cell by column and row 
Php :: composer_update 
Php :: laravel server sent events 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =