summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2026-07-27 22:00:55 +0100
committerSam Light <samlight1994@gmail.com>2026-07-27 22:00:55 +0100
commit827a53363e7a03329d6e5972d9d9be99d17c889e (patch)
tree28875bc15014a0acab23e2d9a9d66a1873bb5e72
parent662efa20b3e3d4834a487eb98f69a3a3ea35ccec (diff)
Updated to support tighter laravel 13 order direction type
-rw-r--r--composer.json3
-rw-r--r--composer.lock82
-rw-r--r--src/Columns/Column.php4
-rw-r--r--src/TableComponent.php6
4 files changed, 91 insertions, 4 deletions
diff --git a/composer.json b/composer.json
index d1004e0..5da1995 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,8 @@
],
"require": {
"livewire/livewire": "^4.1.0",
- "lightscale/laralight-assets": "^1.0.0"
+ "lightscale/laralight-assets": "^1.0.0",
+ "symfony/polyfill-php86": "^1.38"
},
"extra": {
"laravel": {
diff --git a/composer.lock b/composer.lock
index 06f205a..5c82e8c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f8d788b2df21c460d6b34bc2bdf7909c",
+ "content-hash": "325ea7b6622e381e9b00505ce88f58ec",
"packages": [
{
"name": "brick/math",
@@ -4945,6 +4945,86 @@
"time": "2025-06-23T16:12:55+00:00"
},
{
+ "name": "symfony/polyfill-php86",
+ "version": "v1.38.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php86.git",
+ "reference": "fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php86/zipball/fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad",
+ "reference": "fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php86\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.6+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php86/tree/v1.38.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-25T11:52:35+00:00"
+ },
+ {
"name": "symfony/polyfill-uuid",
"version": "v1.33.0",
"source": {
diff --git a/src/Columns/Column.php b/src/Columns/Column.php
index 9b70c3b..ede94f7 100644
--- a/src/Columns/Column.php
+++ b/src/Columns/Column.php
@@ -11,6 +11,7 @@ use Illuminate\Support\HtmlString;
use Illuminate\View\ComponentAttributeBag;
use Lightscale\LaralightTables\Concerns\Makable;
use Lightscale\LaralightTables\TableComponent;
+use SortDirection;
class Column
{
@@ -91,8 +92,9 @@ class Column
* @template TModel of Model
*
* @param Builder<TModel> $query
+ * @param SortDirection|'asc'|'desc'|null $dir
*/
- public function applySort(Builder $query, ?string $dir): void
+ public function applySort(Builder $query, SortDirection|string|null $dir): void
{
if ($this->sortFn !== null) {
($this->sortFn)($query, $dir);
diff --git a/src/TableComponent.php b/src/TableComponent.php
index 516c8da..e36029e 100644
--- a/src/TableComponent.php
+++ b/src/TableComponent.php
@@ -17,6 +17,7 @@ use Lightscale\LaralightTables\Toolbar\Filter;
use Livewire\Attributes\Url;
use Livewire\Component;
use Livewire\WithPagination;
+use SortDirection;
/**
* @template TModel of Model
@@ -64,8 +65,11 @@ abstract class TableComponent extends Component
#[Url]
public ?string $order = null;
+ /**
+ * @var SortDirection|'asc'|'desc'|null
+ */
#[Url]
- public ?string $orderDirection = null;
+ public SortDirection|string|null $orderDirection = null;
public function mount(): void
{