Installation & requirements
The package is a library with no configuration of its own: one command installs it, it registers nothing and needs no settings files. Everything it relies on arrives with its dependencies.
Requirements
| Requirement | Version | Why |
|---|---|---|
| PHP | ≥ 8.4 | promoted properties, new in initializers, readonly |
flytachi/winter-kernel |
^4.0 | request layer: hydration and validation of the grid request |
flytachi/winter-ppa |
^1.0 | data layer: repositories, query builder, paginator |
ext-pdo |
— | comes in through CDO, which the data layer works over |
Both Winter packages are declared in require and installed automatically — you don’t need
to require them separately.
Installation
composer require flytachi/winter-mui-data-gridNothing else: no providers, no config publishing, no bootstrap entries. Classes are
autoloaded via PSR-4 from the Flytachi\Winter\MuiDataGrid namespace.
What your project needs
The library is an overlay, so it assumes two layers are already in place.
The data layer. You need a working repository: a database config class and a repository
over the table. If queries through Repository::instance() already work, you’re ready.
final class ArticleRepository extends Repository
{
protected string $dbConfigClassName = AppDb::class;
public static string $table = 'articles';
}The request layer. The grid request is an ordinary DTO hydrated by the kernel, so the controller must accept a request body through the standard annotation — the same way any other DTO arrives.
Supported databases
| Database | Status | Note |
|---|---|---|
| PostgreSQL | fully supported | case-insensitive search via ILIKE |
| MySQL / MariaDB | fully supported | the collation decides the case (*_ci by default) |
| SQLite | fully supported | LIKE is case-insensitive for ASCII |
| Others (Oracle etc.) | works | case-insensitive search via lower() |
The difference only concerns the four text-search operators and is resolved automatically — see Match modes.
Version compatibility
| Package | winter-kernel | winter-ppa | PHP |
|---|---|---|---|
3.x |
^4.0 |
^1.0 |
≥ 8.4 |
2.x |
^3.0 |
(shipped inside the kernel) | ≥ 8.4 |
Coming from 2.x
Winter 4 moved the root namespace (…\Winter\K2\… → …\Winter\Kernel\…) and split the data
layer out into winter-ppa. No release spans both layouts, so the framework and the adapter
must be upgraded in the same step. The full rename map and a one-liner for the migration are
in Upgrading to 3.0.
Verifying
The quickest check is to build a schema and a condition from it — no database required:
use Flytachi\Winter\MuiDataGrid\Entity\MGFilterItem;
use Flytachi\Winter\MuiDataGrid\Entity\MGFilterModel;
use Flytachi\Winter\MuiDataGrid\Entity\MGOperator;
use Flytachi\Winter\MuiDataGrid\Schema\FilterType;
use Flytachi\Winter\MuiDataGrid\Schema\GridColumn;
use Flytachi\Winter\MuiDataGrid\Schema\GridSchema;
use Flytachi\Winter\MuiDataGrid\Schema\TextMatch;
$schema = GridSchema::make(
GridColumn::for('title', 'a.title')->filterable(FilterType::String)->sortable(),
)->textMatch(TextMatch::ILike);
$where = $schema->buildWhere(new MGFilterModel([
new MGFilterItem('title', MGOperator::CONTAINS, 'winter'),
]));
echo $where->getQuery();Result
a.title ILIKE :iqb0Next: the Quickstart — a working endpoint from repository to table.