samedi 25 avril 2020

How to give order query when using scorp

I'm trying to get image data. giving order by id desc. I add orderBy sentece after get() it didn't work. Could you teach me how to add order query when using :: scope?

public function index()
    {
        $images = ImageGallery::get()->orderBy('id', 'desc');
        return view('image-gallery',compact('images'));
    }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire