lundi 21 mai 2018

Laravel - How can i display what has been sorted

This is my controller

if ($request->input('sort')){
           $sort = $request->input('sort');
if ($sortBy == "asc") {
                        $image_ = Image::where('property_id', $id)-
>orderBy($sort,'asc')->get();
                    // $image_ = Image::where('property_id', $id)->sortBy($sort)->get();

                        return view('settings.photos', ['image_' => $image_]);

This is my blade file

@if( isset($image_))
        @foreach ($image_ as $images)
            <div class="image-warp"><img src=""
                                         style="width:100px;height:100px;"><br/><span style="color: #1b1e21"></span>
            </div>
        @endforeach
@endif

It doesn't display the $images_ variable how can i display it



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire