Export data as CSV file

Premio provides unique and unparallel export system which takes a very few seconds even if your export million records. If you want to export data, just you need to pass the table name like:

@include('admin.modal._export', ['db_table' => 'articles'])

Export without datatable

Now use the export modal button like:

<button class="datatable publish-post" data-bs-target="/docs/1.0/export-csv#exportModal" data-bs-toggle="modal" title="Export"><i class="bx bxs-file-export"></i>Export</button>

Now you have nothing to do. System will automatically export data with selected date range

Export from datatable

Datatable always uses export button. Here you have nothing to do. Just pass the Model name from your index.blade.php file like:

<x-slot name="script">
    <script src="{{ mix('js/datatable.js') }}"></script>
    <script type="text/javascript">
        const columns = ['id', 'title', 'post_views', 'created_at'];
        const route = "{{ route('post.index') }}";
        const order = "asc";
        const button = true;
        const table = 'Article'; // this is for export data
        generate_datatable(route, columns, order, button, table);