This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dfrost
dfrost

It lacks the ability to use random() in Models, like in collections. I wrote by myself two plugins, where i need this function, but instead of, wrote simple SQL queries using Db::select.

daftspunky
daftspunky

Try this

$query->orderByRaw("RAND()");
dfrost
dfrost

Didn't see this in docs. Thank you!

Troiscent
Troiscent

Doesn't work with SQLite

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.