jeudi 27 février 2020

Connecting method/function in laravel

I'm trying to create a class function which resembles how we used to fetch database listing and convert into a dropdown listing.

eg: DB::table()->where()->get()

what i would like to achieve in laravel custom class or through model is this

Dropdown::fetch()->toArray()

Dropdown::fetch()->toDropdown()

I tried to figure out how this can be done through google. But couldn't find any solution to it.

I'm using laravel 5.8



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32xJhd6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire