|
4 | 4 | /* |
5 | 5 | * DataTables search options. |
6 | 6 | */ |
7 | | - 'search' => [ |
| 7 | + 'search' => [ |
8 | 8 | /* |
9 | 9 | * Smart search will enclose search keyword with wildcard string "%keyword%". |
10 | 10 | * SQL: column LIKE "%keyword%" |
11 | 11 | */ |
12 | | - 'smart' => true, |
| 12 | + 'smart' => true, |
13 | 13 |
|
14 | 14 | /* |
15 | 15 | * Multi-term search will explode search keyword using spaces resulting into multiple term search. |
16 | 16 | */ |
17 | | - 'multi_term' => true, |
| 17 | + 'multi_term' => true, |
18 | 18 |
|
19 | 19 | /* |
20 | 20 | * Case insensitive will search the keyword in lower case format. |
|
26 | 26 | * Wild card will add "%" in between every characters of the keyword. |
27 | 27 | * SQL: column LIKE "%k%e%y%w%o%r%d%" |
28 | 28 | */ |
29 | | - 'use_wildcards' => false, |
| 29 | + 'use_wildcards' => false, |
30 | 30 |
|
31 | 31 | /* |
32 | 32 | * Perform a search which starts with the given keyword. |
33 | 33 | * SQL: column LIKE "keyword%" |
34 | 34 | */ |
35 | | - 'starts_with' => false, |
| 35 | + 'starts_with' => false, |
36 | 36 | ], |
37 | 37 |
|
38 | 38 | /* |
39 | 39 | * DataTables internal index id response column name. |
40 | 40 | */ |
41 | | - 'index_column' => 'DT_RowIndex', |
| 41 | + 'index_column' => 'DT_RowIndex', |
42 | 42 |
|
43 | 43 | /* |
44 | 44 | * List of available builders for DataTables. |
45 | 45 | * This is where you can register your custom dataTables builder. |
46 | 46 | */ |
47 | | - 'engines' => [ |
48 | | - 'eloquent' => \Yajra\DataTables\EloquentDataTable::class, |
49 | | - 'query' => \Yajra\DataTables\QueryDataTable::class, |
50 | | - 'collection' => \Yajra\DataTables\CollectionDataTable::class, |
51 | | - 'resource' => \Yajra\DataTables\ApiResourceDataTable::class, |
| 47 | + 'engines' => [ |
| 48 | + 'eloquent' => Yajra\DataTables\EloquentDataTable::class, |
| 49 | + 'query' => Yajra\DataTables\QueryDataTable::class, |
| 50 | + 'collection' => Yajra\DataTables\CollectionDataTable::class, |
| 51 | + 'resource' => Yajra\DataTables\ApiResourceDataTable::class, |
52 | 52 | ], |
53 | 53 |
|
54 | 54 | /* |
55 | 55 | * DataTables accepted builder to engine mapping. |
56 | 56 | * This is where you can override which engine a builder should use |
57 | 57 | * Note, only change this if you know what you are doing! |
58 | 58 | */ |
59 | | - 'builders' => [ |
| 59 | + 'builders' => [ |
60 | 60 | //Illuminate\Database\Eloquent\Relations\Relation::class => 'eloquent', |
61 | 61 | //Illuminate\Database\Eloquent\Builder::class => 'eloquent', |
62 | 62 | //Illuminate\Database\Query\Builder::class => 'query', |
63 | 63 | //Illuminate\Support\Collection::class => 'collection', |
64 | 64 | ], |
65 | 65 |
|
66 | 66 | /* |
67 | | - * Nulls last sql pattern for Posgresql & Oracle. |
68 | | - * For MySQL, use '-%s %s' |
| 67 | + * Nulls last sql pattern for PostgreSQL & Oracle. |
| 68 | + * For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction' |
69 | 69 | */ |
70 | | - 'nulls_last_sql' => '%s %s NULLS LAST', |
| 70 | + 'nulls_last_sql' => ':column :direction NULLS LAST', |
71 | 71 |
|
72 | 72 | /* |
73 | 73 | * User friendly message to be displayed on user if error occurs. |
|
76 | 76 | * 'throw' - Throws a \Yajra\DataTables\Exceptions\Exception. Use your custom error handler if needed. |
77 | 77 | * 'custom message' - Any friendly message to be displayed to the user. You can also use translation key. |
78 | 78 | */ |
79 | | - 'error' => env('DATATABLES_ERROR', null), |
| 79 | + 'error' => env('DATATABLES_ERROR', null), |
80 | 80 |
|
81 | 81 | /* |
82 | 82 | * Default columns definition of dataTable utility functions. |
83 | 83 | */ |
84 | | - 'columns' => [ |
| 84 | + 'columns' => [ |
85 | 85 | /* |
86 | 86 | * List of columns hidden/removed on json response. |
87 | 87 | */ |
88 | | - 'excess' => ['rn', 'row_num'], |
| 88 | + 'excess' => ['rn', 'row_num'], |
89 | 89 |
|
90 | 90 | /* |
91 | 91 | * List of columns to be escaped. If set to *, all columns are escape. |
92 | 92 | * Note: You can set the value to empty array to disable XSS protection. |
93 | 93 | */ |
94 | | - 'escape' => '*', |
| 94 | + 'escape' => '*', |
95 | 95 |
|
96 | 96 | /* |
97 | 97 | * List of columns that are allowed to display html content. |
98 | 98 | * Note: Adding columns to list will make us available to XSS attacks. |
99 | 99 | */ |
100 | | - 'raw' => ['action'], |
| 100 | + 'raw' => ['action'], |
101 | 101 |
|
102 | 102 | /* |
103 | 103 | * List of columns are are forbidden from being searched/sorted. |
|
114 | 114 | /* |
115 | 115 | * JsonResponse header and options config. |
116 | 116 | */ |
117 | | - 'json' => [ |
| 117 | + 'json' => [ |
118 | 118 | 'header' => [], |
119 | 119 | 'options' => 0, |
120 | 120 | ], |
|
0 commit comments