protonemedia / laravel-splade

💫 The magic of Inertia.js with the simplicity of Blade 💫 - Splade provides a super easy way to build Single Page Applications (SPA) using standard Laravel Blade templates, and sparkle it to make it interactive. All without ever leaving Blade.
https://splade.dev
MIT License
1.47k stars 112 forks source link

Export doesnt working at controller splade table #634

Open kahfieidn opened 6 months ago

kahfieidn commented 6 months ago

i try to adding splade table in controller:

  return view('admin.management_user.index', [
            'year' => $year,
            'users' => SpladeTable::for($users)
                ->withGlobalSearch(columns: ['id'])
                ->column('id', sortable: true)
                ->column('name', sortable: true, label: 'Nama PPTK')
                ->column('nip', sortable: true)
                ->column('email', sortable: true)
                ->column('year', sortable: true, label: 'Periode')
                ->column('roles.name', sortable: true, label: 'Role')
                ->export()
        ]);

but error when i adding export, why export not working at controller, but in artisan make table working fine.

any solve for this? log error is here:

get_class(): Argument #1 ($object) must be of type object, null given
vikaCoconutlab commented 5 months ago

Same, does anyone have a solution?