Comments (1)
Hi @chris5560, you have to declare as much as tables as you want and send them to the view.
You would have to do this in your controller for example:
public function index()
{
$usersTable = (new \Okipa\LaravelTable\Table)
->model(\App\User::class)
->routes(['index' => ['name' => 'users.index']])
->identifier('Users table');
$usersTable->column('name')->sortable()->searchable();
$newsTable = (new \Okipa\LaravelTable\Table)
->model(\App\News::class)
->routes(['index' => ['name' => 'news.index']])
->identifier('News table');
$newsTable->column('title')->sortable()->searchable();
return view('your.view.path', compact('usersTable', 'newsTable'));
}
And then in your view:
{{ $usersTable }}
{{ $newsTable }}
This way, your will be able to realize actions like searching or sorting independently for each table.
from laravel-table.
Related Issues (20)
- Column action still displays original column value with ->when(false) HOT 1
- BooleanFormatter Doesn't appear to add yes or no HOT 2
- "SQLSTATE[42883]: Undefined function: 7 ERROR: function lower(date) does not exist" error searching HOT 8
- Tables Never Actually Load (infinite Loading state) HOT 7
- Unable to find component: [table] HOT 3
- Column not extendable because of `self` HOT 1
- Error on results' total showed HOT 1
- Search by does not refresh the page number HOT 3
- Table Information not clearing on pagination/search HOT 2
- Compatibility Issue with Livewire v3.x HOT 3
- RedirectRowAction to new window causes duplicate full query
- Suggestion: Allow diffForHumans for dateTimeFormat HOT 3
- SUGESTION: Create config for tailwind tables HOT 4
- Searchable by integer column HOT 5
- Eager load relations HOT 2
- [Feature Request] Feature to reorder rows HOT 2
- Is this package compatible with the latest versions of Laravel namely 8 and 9 ??? HOT 3
- Error when using multiple aliases with join statements HOT 2
- Support for Laravel 9 HOT 7
- Migration difficulties with routes, HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-table.