Skip to content

Commit bc3e4e4

Browse files
committed
Update docs
1 parent cac2110 commit bc3e4e4

File tree

1 file changed

+7
-36
lines changed

1 file changed

+7
-36
lines changed

README.md

+7-36
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/designbycode/eloquent-datatable/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/designbycode/eloquent-datatable/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/designbycode/eloquent-datatable.svg?style=flat-square)](https://packagist.org/packages/designbycode/eloquent-datatable)
77

8-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
8+
An Eloquent way to build datatables.
99

10-
## Support us
11-
12-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/eloquent-datatable.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/eloquent-datatable)
13-
14-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
15-
16-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
1710

1811
## Installation
1912

@@ -23,37 +16,15 @@ You can install the package via composer:
2316
composer require designbycode/eloquent-datatable
2417
```
2518

26-
You can publish and run the migrations with:
27-
28-
```bash
29-
php artisan vendor:publish --tag="eloquent-datatable-migrations"
30-
php artisan migrate
31-
```
32-
33-
You can publish the config file with:
34-
19+
## Usage
20+
To create a datatable controller you have to run the following command. This will generate a new controller with all the needed files.
3521
```bash
36-
php artisan vendor:publish --tag="eloquent-datatable-config"
22+
php artisan datatable:create PostsDatatableController
3723
```
38-
39-
This is the contents of the published config file:
40-
41-
```php
42-
return [
43-
];
44-
```
45-
46-
Optionally, you can publish the views using
47-
24+
The artisan command comes with 2 optional parameters.
25+
The `--model` parameter defines which model to use for the datatable. The `--middleware` parameter defines which middleware to use for the datatable.
4826
```bash
49-
php artisan vendor:publish --tag="eloquent-datatable-views"
50-
```
51-
52-
## Usage
53-
54-
```php
55-
$eloquentDatatable = new Designbycode\EloquentDatatable();
56-
echo $eloquentDatatable->echoPhrase('Hello, Designbycode!');
27+
php artisan datatable:create PostsDatatableController --model=Post --middleware=auth,auth.admin
5728
```
5829

5930
## Testing

0 commit comments

Comments
 (0)