Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Livewire Tables Laravel Package

rappasoft/laravel-livewire-tables

Laravel Livewire Tables provides dynamic, feature-rich data tables for Laravel Livewire with sorting, searching, filtering, pagination, bulk actions, and Bootstrap/Tailwind support. Build reusable table components backed by Eloquent queries.

View on GitHub
Deep Wiki
Context7

title: One Of Many Example weight: 8

When trying to retrieve "OneOfMany", you may experience duplicate records.

Core functionality for this will be added in due course, this is simply a work-around.

In the meantime, to avoid this, you can use the following approach.

This example assumes two Models: User -> HasMany -> Things

Models

User

id name created_at updated_at etc

    public function things(): \Illuminate\Database\Eloquent\Relations\HasMany
    {
        return $this->hasMany(Things::class);
    }

Things

id name user_id created_at updated_at

Table

The following is the table code for this example, and retrieves the most recently created "Thing"

Column

    Column::make('Latest Thing')
    ->label(
        fn ($row, Column $column) => $row->things->first()->name
    ),

Builder

    public function builder(): Builder {

        return User::query()->with(['things' => function ($query) {
                $query->select(['id','user_id','name'])->orderBy('created_at', 'desc')->limit(1);
        }]);

    }

Core functionality for this will be added in due course, this is simply a work-around.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport