jeudi 26 août 2021

how to fill @empty at laravel?

this my source code and I apologize for the messy layout of my code syntax, i want to fill the td like this enter image description here

source code

                         <tbody>
                          @forelse ($kaders as $kader)
                            <tr>
                                <td></td>
                                @if($kader->status_user == '1')
                                    <td>Admin</td>
                                @elseif($kader->status_user == '0')
                                    <td>Ibu / Guest</td>
                                @endif
                                @forelse ($surveillances as $surveillance)
                                    @if($kader->username == $surveillance->nik_ortu)
                                        @if($surveillance->status == '1')
                                        <td>Aktif</td>
                                        @elseif($surveillance->status == '0')
                                        <td>NonAKtif</td>
                                        @endif
                                    @endif
                                        <!-- <td>admin</td> -->
                                    @empty
                                        <td>admin</td>
                                @endforelse
                                <td class="text-center">
                                    <form onsubmit="return confirm('Apakah Anda Yakin ?');" action="" method="POST">
                                        <a href="" class="btn btn-sm btn-primary"><i class="far fa-edit"></i> EDIT</a>
                                        @csrf
                                        @method('DELETE')
                                        <button type="submit" class="btn btn-sm btn-danger"><i class="far fa-trash-alt"></i> HAPUS</button>
                                    </form>
                                </td>
                            </tr>
                          @empty
                              <div class="alert alert-danger">
                                  Data Kader belum Tersedia.
                              </div>
                          @endforelse
                        </tbody>

how can i fill that ? or maybe I don't really understand how to use @empty

Aucun commentaire:

Enregistrer un commentaire