Skip to content

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()
  ->displayAppend('full')
  ->searchColumns('email')
  ->fromModel(
      model: User::where('id', '>', 5)
          ->where('email', '!=', '[email protected]')
          ->has('orders'),
      name: 'name',
      key: 'email',
      chunk: 20,
  )
  ->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