Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

datatables.php 3.8KB

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