Skip to content

Commit

Permalink
add readme ⚡
Browse files Browse the repository at this point in the history
  • Loading branch information
rizkhal committed Feb 23, 2022
1 parent ca6b261 commit e848649
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
89 changes: 88 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,88 @@
## INERTIA DATATABLE
## INERTIA DATATABLE

<img src="./art/art.png" alt="Art" />

## RERUITMENT
- php8.1
- inertiajs
- laravel 8 | 9

## INSTALATION
```bash
composer require rizkhal/inertable
```

## USAGE
```bash
php artisan make:inertable UserTable
```

This will be generate a basic inertable starter
```php
<?php

declare(strict_types=1);

namespace App\Inertable;

use Rizkhal\Inertable\Column;
use Rizkhal\Inertable\Inertable;
use Illuminate\Database\Eloquent\Builder;

class UserTable extends Inertable
{
public function query(): Builder
{
// ...
}

public function columns(): array
{
return [
// ...
];
}
}
```

## EXAMPLE

### BASIC
```php
<?php

declare(strict_types=1);

namespace App\Inertable;

use App\Models\User;
use Rizkhal\Inertable\Column;
use Illuminate\Support\Carbon;
use Rizkhal\Inertable\Inertable;
use Illuminate\Database\Eloquent\Builder;

class UserTable extends Inertable
{
public function query(): Builder
{
return User::query();
}

public function columns(): array
{
return [
Column::blank()->checkbox(),
Column::make(__('Name'), 'name')->sortable()->searchable(),
Column::make(__('Email'), 'email')->sortable()->searchable(),
Column::make(__('Verified'), 'email_verified_at')->sortable()->searchable()->format(fn (Carbon $value): string => $value->format('d/m/Y')),
Column::make(__('status'), 'status')->sortable()->searchable(),
Column::blank(),
];
}
}
```

### ADVANCE
...


Binary file added art/art.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": "^8.1",
"illuminate/support": "^8.62|^9.0.0",
"inertiajs/inertia-laravel": "dev-master"
"inertiajs/inertia-laravel": "^0.5.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.1",
Expand Down

0 comments on commit e848649

Please sign in to comment.