Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f3cc963
Update README.md
jdanino Aug 15, 2022
f6e3644
Add a active-classes prop so the active element color can be configured
jdanino Aug 24, 2022
39efdbe
Add active-filters component
jdanino Aug 24, 2022
5ba89fa
count 0 filters as active
jdanino Aug 24, 2022
be35bd3
Merge branch 'feature/add-active-color-prop' into develop
jdanino Aug 24, 2022
abf550d
Merge branch 'feature/active-filters' into develop
jdanino Aug 24, 2022
b8f89e3
fix merge
jdanino Aug 24, 2022
a49e680
Add Contitional trait to table
jdanino Aug 31, 2022
cba9a43
Update composer.json
jdanino Dec 13, 2022
e9dce78
Support laravel 10
jdanino Feb 15, 2023
f745121
Update composer.json
jdanino Feb 15, 2023
425490f
Fix required parameter order
jdanino Feb 17, 2023
f80e4de
Make php 8.0 a requirement as its features are used in the code base
jdanino Feb 17, 2023
8654ccf
Merge branch 'develop' of https://github.com/jdanino/inertiajs-tables…
jdanino Feb 17, 2023
8cbf427
Merge branch 'develop'
jdanino Feb 17, 2023
7b6d106
add click event
sietzekeuning Mar 21, 2023
e628bb9
Fix styling
sietzekeuning Mar 21, 2023
8ef83fe
Merge pull request #1 from sietzekeuning/patch-1
jdanino Mar 21, 2023
104e809
update packages and add focus classes
sietzekeuning Mar 22, 2023
239e441
Update package.json
sietzekeuning Mar 22, 2023
3bda258
Merge pull request #2 from sietzekeuning/main
jdanino Mar 22, 2023
577184f
Merge branch 'jdanino:main' into main
sietzekeuning Mar 22, 2023
2ed1774
Merge pull request #3 from sietzekeuning/main
jdanino Mar 22, 2023
d1a4aa5
Update illuminate version
jdanino Apr 20, 2023
0c3006e
Laravel 11
sietzekeuning Apr 10, 2024
3f77a7a
Merge pull request #4 from sietzekeuning/patch-1
jdanino Apr 10, 2024
fc04a14
Update composer.json
jdanino Feb 27, 2025
f48210b
Update dependecies
jdanino Feb 27, 2025
0a00a6d
Bump inertia to 2.0
jdanino Feb 28, 2025
602a4a6
Upgrade to use Inertia 2
jdanino Apr 4, 2025
4a6e500
Add some props for hiding search and pagination
jdanino Oct 9, 2025
41c6faf
Publish new version
jdanino Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"permissions": {
"allow": [
"Bash(npm run build:*)",
"Bash(git tag:*)",
"Bash(git push:*)",
"Bash(npm publish:*)"
],
"deny": [],
"ask": []
}
}
127 changes: 121 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Inertia.js Tables for Laravel Query Builder

This package provides a set of components to build Inertia.js tables using [Spatie's Laravel Query Builder](https://github.com/spatie/laravel-query-builder).

## Version Compatibility

| Package Version | Inertia.js Version | Laravel Version |
|-----------------|-------------------|-----------------|
| 2.x | 0.x | 8.x, 9.x, 10.x |
| 3.x | 1.x, 2.x | 8.x, 9.x, 10.x |

## Upgrading from v2.x to v3.x

Version 3.x of this package supports Inertia.js 2.0. If you're upgrading from v2.x, you'll need to:

1. Update your dependencies:
```bash
npm remove @inertiajs/inertia @inertiajs/inertia-vue3 @inertiajs/progress
npm install @inertiajs/vue3
```

2. Update your imports:
- Replace `@inertiajs/inertia-vue3` with `@inertiajs/vue3`
- Replace `@inertiajs/inertia` with `@inertiajs/vue3`
- Replace `@inertiajs/progress` with the progress module from `@inertiajs/vue3`

3. Update your Inertia setup:
- The `setup` function now receives `App` instead of `app`
- Use the `router` and `usePage()` instead of `$inertia` and `$inertia.page`
- Update event listeners from `inertia:success` to `success`

For more details on upgrading to Inertia.js 2.0, see the [official upgrade guide](https://inertiajs.com/upgrade-guide).

# Inertia.js Tables for Laravel Query Builder

[![Latest Version on NPM](https://img.shields.io/npm/v/@protonemedia/inertiajs-tables-laravel-query-builder.svg?style=flat-square)](https://npmjs.com/package/@protonemedia/inertiajs-tables-laravel-query-builder)
[![npm](https://img.shields.io/npm/dt/@protonemedia/inertiajs-tables-laravel-query-builder.svg?style=flat-square)](https://www.npmjs.com/package/@protonemedia/inertiajs-tables-laravel-query-builder)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/protonemedia/inertiajs-tables-laravel-query-builder.svg?style=flat-square)](https://packagist.org/packages/protonemedia/inertiajs-tables-laravel-query-builder)
Expand Down Expand Up @@ -270,16 +303,18 @@ The `Table` has some additional properties to tweak its front-end behaviour.
:prevent-overlapping-requests="false"
:input-debounce-ms="1000"
:prevent-scroll="true"
:active-classes="{text: 'text-red-500', border: 'border-red-300'}"
/>
</template>
```

| Property | Description | Default |
| --- | --- | --- |
| striped | Adds a *striped* layout to the table. | `false` |
| preventOverlappingRequests | Cancels a previous visit on new user input to prevent an inconsistent state. | `true` |
| inputDebounceMs | Number of ms to wait before refreshing the table on user input. | 350 |
| preventScroll | Configures the [Scroll preservation](https://inertiajs.com/scroll-management#scroll-preservation) behavior. You may also pass `table-top` to this property to scroll to the top of the table on new data. | false |
| Property | Description | Default |
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
| striped | Adds a *striped* layout to the table. | `false` |
| preventOverlappingRequests | Cancels a previous visit on new user input to prevent an inconsistent state. | `true` |
| inputDebounceMs | Number of ms to wait before refreshing the table on user input. | 350 |
| preventScroll | Configures the [Scroll preservation](https://inertiajs.com/scroll-management#scroll-preservation) behavior. You may also pass `table-top` to this property to scroll to the top of the table on new data. | false |
| activeClasses | Configures the CSS classes to apply on active elements like filters & column buttons and sorting indicator | {text: 'text-green-400', border: 'border-green-300' } |

#### Custom column cells

Expand Down Expand Up @@ -465,6 +500,86 @@ php artisan dusk
* Date range filters
* Switch to Vite for the demo app

## Local Development

If you want to work on this package locally and test changes in your application, you can use npm's `file:` protocol to create a symlink.

### Setup

1. **Clone the package repository** to your local machine:
```bash
git clone https://github.com/your-username/inertiajs-tables-laravel-query-builder.git /path/to/package
```

2. **Install package dependencies**:
```bash
cd /path/to/package
npm install
```

3. **Update your application's `package.json`** to point to the local package:
```json
{
"devDependencies": {
"@protonemedia/inertiajs-tables-laravel-query-builder": "file:/absolute/path/to/package"
}
}
```

4. **Install dependencies in your application**:
```bash
cd /path/to/your-application
npm install
```
This will create a symlink from `node_modules/@protonemedia/inertiajs-tables-laravel-query-builder` to your local package directory.

5. **Start the package build watcher** (in the package directory):
```bash
cd /path/to/package
npm run dev
```
This runs `vite build --watch`, which will automatically rebuild the package whenever you make changes.

6. **Start your application's dev server** (in another terminal):
```bash
cd /path/to/your-application
npm run dev
```

### Making Changes

Now any changes you make to the package source files will:
1. Be automatically rebuilt by the package's watch process
2. Be immediately available to your application via the symlink
3. Trigger your application's hot module reload (if using Vite/HMR)

### Installing the Composer Package

If you also forked the package and want to use your fork in your Laravel application:

```bash
composer require protonemedia/inertiajs-tables-laravel-query-builder:dev-main
```

Make sure to update your `composer.json` to point to your fork:

```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/your-username/inertiajs-tables-laravel-query-builder"
}
]
}
```

### Troubleshooting

- **Changes not appearing?** Make sure the package's `npm run dev` is running and watch for build errors
- **Old build artifacts?** Try deleting the `dist` folder in the package and rebuilding
- **Symlink not working?** Run `npm install` again in your application to recreate the symlink

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
Expand Down
18 changes: 0 additions & 18 deletions app/.editorconfig

This file was deleted.

53 changes: 0 additions & 53 deletions app/.env.example

This file was deleted.

10 changes: 0 additions & 10 deletions app/.gitattributes

This file was deleted.

14 changes: 0 additions & 14 deletions app/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions app/app/Console/Kernel.php

This file was deleted.

50 changes: 0 additions & 50 deletions app/app/Exceptions/Handler.php

This file was deleted.

Loading