Yes, you can achieve this by using a subquery to count the number of pictures for each user and then ordering by that count. Here's an example using Laravel's query builder:
$users = DB::table('users')
->select('users.*', DB::raw('COUNT(pictures.id) as num_pictures'))
->leftJoin('pictures', 'users.id', '=', 'pictures.user_id')
->groupBy('users.id')
->orderBy('num_pictures', 'desc')
->get();
In this example, we're selecting all columns from the users table and using DB::raw to count the number of pictures for each user. We're then left joining the pictures table on the user_id column, grouping by the users.id column, and ordering by the num_pictures count in descending order.
Note that this example assumes that the pictures table has a foreign key user_id that references the id column in the users table.