-
-
Notifications
You must be signed in to change notification settings - Fork 858
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
[Feature] Add support SearchBuilder #2648
Comments
Search builder extension only works on client-side. Will consider this once the serverSide implementation is available. |
hey @yajra SearchBuilder support server-side processing in version 1.2 |
@vanthao03596 Can you please provide some links for reference? |
+1 |
@yajra @hamzaFpco i made a gist with simple scope for SearchBuilder base on datatable. Hope it can help |
hi, how to use this script? |
Use this trait in your model |
thanks for sharing. https://gist.github.com/armadeas/61d0ed9e846c3ede8afa3fc6cdc18a97 |
Thank you very much. This is very good 😊😊😊👍👏❤ |
Hi. Thanks a lot. Why did you use the protected function searchBuilderCondition($query, $data, $columns)
{
// . . .
} |
yes because I use relationships from several tables, so that the searchbuilder can work specifically on which columns from the table to filter |
Thank you for your answer. I had another question. The following class is not defined in the scope you wrote. Where is this class? use Yajra\DataTables\Contracts\DataTableScope;
class SearchBuilderScope implements DataTableScope
{
// . . .
} |
sorry if it's messy. after that the contents are https://gist.github.com/armadeas/61d0ed9e846c3ede8afa3fc6cdc18a97 |
Hello dear friends. @yajra @armadeas @vanthao03596 |
Can anyone provide a working sample code? I did the whole process above but it still returns the error Class "App\DataTables\Scopes\SearchBuilderScope" not found I think I have a problem calling the scope in the Model |
@vanthao03596 '!contains' case block is missing. |
If you want to use SearchBuilder with a server-side implementation, you may find this article helpful. |
Hi Saiful,
Thank you for your e-mail.
Best Regards,
Yuri
De: Saiful Islam ***@***.***>
Enviada em: domingo, 16 de abril de 2023 11:47
Para: yajra/laravel-datatables ***@***.***>
Cc: Yuri Araujo ***@***.***>; Comment ***@***.***>
Assunto: Re: [yajra/laravel-datatables] [Feature] Add support SearchBuilder (#2648)
If you want to use SearchBuilder with a server-side implementation, you may find this article helpful.
***@***.***/implementing-searchbuilder-with-yajra-datatables-in-laravel-a-step-by-step-guide-39314791ac5b
—
Reply to this email directly, view it on GitHub<#2648 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A25KZZJCZWU2O4A3DRHRINTXBQA5JANCNFSM46T2TNTQ>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
Yes that's perfect keep updating that.... |
@saaiful Is it possible to get this working with model attributes set using accessors, the columns wouldn't exist in the DB so I obviously get an error from SQL. I would like to be able to filter based on these fields using Search Builder. |
Hi,
Thank you for your e-mail. I will try it.
Best Regards
Yuri
De: ale1981 ***@***.***>
Enviada em: terça-feira, 12 de dezembro de 2023 14:43
Para: yajra/laravel-datatables ***@***.***>
Cc: Yuri Araujo ***@***.***>; Comment ***@***.***>
Assunto: Re: [yajra/laravel-datatables] [Feature] Add support SearchBuilder (#2648)
If you want to use SearchBuilder with a server-side implementation, you may find this article helpful.
***@***.***/implementing-searchbuilder-with-yajra-datatables-in-laravel-a-step-by-step-guide-39314791ac5b
@saaiful<https://github.com/saaiful> Is it possible to get this working with model attributes set using accessors, the columns wouldn't exist in the DB so I obviously get an error from SQL.
I would like to be able to filter based on these fields using Search Builder.
—
Reply to this email directly, view it on GitHub<#2648 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A25KZZOVRV6LIHKN73IRRCTYJCJRZAVCNFSM46T2TNT2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVGI2TCNJVHE4Q>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
You cannot filter data directly based on an accessor when using Yajra DataTables with the Eloquent driver in Laravel. Accessors are used to modify or format data when it's retrieved from the database, but they are not used for filtering or querying data. |
U can try use whereHas with the filter without any modification, of course, is a whereHas by every related model:
|
SearchBuilder is new extension and really good. Can we add support this ?
The text was updated successfully, but these errors were encountered: