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 Table Laravel Package

okipa/laravel-table

View on GitHub
Deep Wiki
Context7

Upgrade from v1 to v2

The v2 is a major rewrite of a big part of the package.

Follow the steps below to upgrade the package.

Config changes

Some config changes have been made. If you customized it, you should re-publish it and reapply your changes.

Translations removed

The translations files have been removed and will not be used anymore.

Translations have now to be handled this way.

Template changes

Some template changes have been made. If you customized them, you should re-publish them and reapply your changes.

Architecture and usage changes

The table configurations are now gathered in the app/Tables directory.

To follow the package upgrade, you should execute the following steps for each table you declared:

  • Create the table configuration boilerplate. Eg: php artisan make:table UsersTable --model=App/User.
  • Move your table configuration in the created table class.
  • Call your table configuration like following (in your controller for example): $table = (new UsersTable())->setup(); and pass it to the view.
  • Display your table in your view as usual: {{ $table }}.

API changes

There are small changes in the API you will have to report in your code:

  • Rename each Table use of ->resultsComponentPath( by ->resultsTemplatePath(.
  • Rename each Table use of ->icon( by ->prependHtml(.
  • Rename each Table use of ->appends( by ->appendData(.
  • Rename each Table use of ->rowsNumberSelectionActivation( by ->activateRowsNumberDefinition(.
  • Rename each Column use of ->prepend( by ->prependHtml(.
  • Rename each Column use of ->append( by ->appendsHtml(.

Accessing table rows

If for any reason you need to work with the table rows, you now will have to do it this way:

$table = (new UsersTable())->setup();
$rows = $table->getPaginator()->getCollection();

Instead of this way in previous versions:

$table = (new Table());
// ... Any table configuration
$table->render();
$table->list->getCollection();

As so, you should search for all $table->list use in your code and make the necessary replacements.

See all changes

See all change with the comparison tool.

Undocumented changes

If you see any forgotten and undocumented change, please submit a PR to add them to this upgrade guide.

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui