@php // Backward-compatible, configurable DataTables initializer (client-side or server-side) $serverSide = $serverSide ?? false; // bool $ajaxUrl = $ajaxUrl ?? null; // string route URL $ajaxDataJs = $ajaxDataJs ?? null; // raw JS to add custom params: e.g. "d.type = $('#type').val();" $columns = $columns ?? null; // array of columns for server-side: [['data' => 'date', 'name' => 'date'], ...] $order = $order ?? null; // array e.g. [[0, 'desc']] $pageLength = $pageLength ?? null; // int $dom = $dom ?? null; // string e.g. 'Blfrtip' $buttons = $buttons ?? null; // array e.g. ['copy', 'csv'] $lengthMenu = $lengthMenu ?? [[5, 10, 15, 20],[5, 10, 15, 20]]; $dtOptions = $dtOptions ?? []; // additional DataTables options @endphp