laravel-livewire-tables icon indicating copy to clipboard operation
laravel-livewire-tables copied to clipboard

Using $this when not in object context

Open keizah7 opened this issue 1 year ago • 5 comments

For some reason if datatable is above simple table with links it throws this exception

https://flareapp.io/share/17D2EGvm

Commenting out

$bills->links()

or moving datatable below this code, solves and issue.

Changing pageName doesn't help

->paginate(12, ['*'], 'pg');

keizah7 avatar Aug 31 '22 08:08 keizah7

Not sure why you're trying to use $this in a blade, unless I've missed something!

If you've set the variable or method to public, then $this is not required and you can reference as you've done elsewhere in your code.

lrljoe avatar Sep 10 '22 05:09 lrljoe

I don't use $this in blade file. I just got error with that message, I'm using $bills

keizah7 avatar Sep 12 '22 07:09 keizah7

Apologies, I must have been half asleep.

Just to check, are you given the simple table a name for pagination purposes otherwise it'll be getting confused! e.g. return view('livewire.show-posts', [ 'posts' => $post->comments()->paginate(10, ['*'], 'commentsPage'), ]);

lrljoe avatar Sep 15 '22 20:09 lrljoe

I tried this one, it didin't help

keizah7 avatar Sep 16 '22 06:09 keizah7

Can you paste your entire resources/views/bill/index.blade.php, or drop me a link to it, and I'll see if I can reproduce from my end.

I'm assuming you're not seeing any "multiple root elements detected" errors in the console, as this would potentially cause the issue if the DOM is broken.

lrljoe avatar Sep 16 '22 16:09 lrljoe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 17 '22 06:10 stale[bot]