Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15.0 dev new select #2963

Open
wants to merge 19 commits into
base: 15.0-dev
Choose a base branch
from

Conversation

bald-cat
Copy link
Contributor

@bald-cat bald-cat commented Feb 28, 2025

Proposed Changes

  • Added new Select field. The field combines the functionality of the Select field and the Relation field
  • The method of sending a request to the controller has been changed from passing the model name to passing the model itself along with the builder.

Now work:

  • fromEnum - moved from the old field
  • fromModel - can now accept model name or query builder
  • added lazy() method
  • added QuerySerializer class

Need to do:

  • clean the controller - DONE
  • add support for older versions in search - DONE
  • transfer various small methods like empty(), taggable() and other - DONE
  • decide whether you need two methods chunk() and lazy() or combine them into one - DONE
  • enum support in controller - DONE
  • change FormRequest - DONE

Example:

Select2::make('users_test')
  ->multiple()
  ->chunk(20)
  ->displayAppend('full')
  ->searchColumns('email')
  ->fromModel(
      model: User::where('id', '>', 5)
          ->where('email', '!=', '[email protected]')
          ->has('orders'),
      name: 'name',
      key: 'email'
  )
  ->title('Select2 for Eloquent model'),
                       

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant