platform icon indicating copy to clipboard operation
platform copied to clipboard

Relation Field only returns max of 10 results

Open dl-web-dev opened this issue 5 years ago • 3 comments

Describe the bug Relation field is only returning the 10 most recent records.

Expected behavior Relation field with scope allied should return all the results that match that scope.

My Scope being applied: public function scopeRes(Builder $query, $restaurant) { return $query ->select([ 'menu_categories.*' ]) ->join('restaurants', 'restaurants.id', '=', 'menu_categories.restaurant_id') ->where('restaurants.restaurant_name', '=', $restaurant) ->get(); }

Server (please complete the following information):

  • Platfrom Version: 10.8.2
  • Laravel Version: 8.40
  • PHP Version: 8
  • Database: MySQL

dl-web-dev avatar Jul 10 '21 14:07 dl-web-dev

The RelationController generally only reads 10 items. It would be great if you could control it.

Davka avatar Aug 12 '21 14:08 Davka

No reason to get more then 10 items for Relation. For small lists you can use Select instead.

ghost avatar Aug 13 '21 11:08 ghost

The difference between the Select field and Relation is that one field displays all options at once, while the other load's information in chunks and is preferable for large tables.

If you need to display all the available options, consider using the Select field.

tabuna avatar Aug 16 '21 22:08 tabuna