Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Laravel loop with counter

 @foreach($rows as $row)
            <tr>
                <td>{{ $loop->iteration }}</td>
                <td>{{ $row->item1}}</td>
                <td>{{ $row->item2}}</td>
            </tr>
 @endforeach
Comment

laravel loop counter

@foreach($items as $key => $item)
  <tr>
  	<td>{{ $loop->iteration }}</td> //its like serial of row 
  	<td>{{ $item->name }}</td>
  	<td>{{ $item->email }}</td>
  </tr>
@endforeach
Comment

PREVIOUS NEXT
Code Example
Php :: php console output 
Php :: Download a file from external server using PHP - Move one project to another server 
Php :: for loop php 
Php :: php convert words with spaces to camelcase 
Php :: wordpress get username 
Php :: redirect in codeigniter 
Php :: php sha256 example 
Php :: php date + 1 year 
Php :: php image to base64 
Php :: custom js css using wordpress hook 
Php :: how to remove token while logout using laravel 8 
Php :: hash a password php 
Php :: wordpress post date 
Php :: php echo html as text 
Php :: php remove characters not numbers or letters 
Php :: carbon date from format 
Php :: carbon parse subday 
Php :: php discord webhook 
Php :: laravel controller return message 
Php :: set character set utf8 in pdo php 
Php :: behamin bresource collection 
Php :: yii1 set flash 
Php :: merge two objects in php 
Php :: disable register laravel 
Php :: wordpress echo the page title 
Php :: laravel redirect back 
Php :: wordpress disable theme editor 
Php :: debug query in moodle 
Php :: laravel where between cluse 
Php :: php curl ssl verify 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =