mercredi 18 janvier 2017

Take variable outside foreach loop in Laravel

I have a query which show information from two tables in foreach loop on my blade view. This is the controller

public function details( $id ){

    $details = Item::find($id)->report;

    return view('details', compact('details'));
} 

On my view I have

@foreach($details as $itemDetails)
    ....
@endforeach 

Is it possible to show before foreach single variable from this query like?



@foreach($details as $itemDetails)
    ....
@endforeach 

I want to get the $id.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2iUfwhH
via IFTTT

Aucun commentaire:

Enregistrer un commentaire