mercredi 26 avril 2017

Laravel 5.4, user cannot see dashboard if they don't own anything

The problem is, is that when I sign a new user up (in my application a 'charity owner'), they are redirected to their dashboard.

On the dashboard, displays the all the charities that the user owns and any donations made to them in another table.

However, because the user has not added their charity to the database yet I am getting undefined variables.

 @forelse($ownedCharities as $owned)

     <td>  </td>
     <td>  Not Available </td>
     <td> <p id="desc">  </p> <a href="#"> <p style="color: #000;" class="seeMore"> See more... </p> </a> </td>
     <a href="#"> <button class="btn btn-danger btnPopover"
                                    data-toggle="popover" data-placement="top"> Delete </button> </a> </td>

     <td> <a href=""> <button class="btn btn-warning"> Edit </button> </a> </td>

 </tr>

 @empty

     <p> No charities owned </p>

 @endforelse

I am using Blade's @forelse



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire