Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions add-column.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Add Column

You can add a custom column on your response by using `addColumn` api.
You can add a custom column to your response by using the `addColumn` api.

> {note} added columns are assumed to be computed columns and not part of the database. Thus, search/sort will be disabled on those columns. If you need them, use the `editColumn` api instead.
> {note} added columns are assumed to be computed columns and not part of the database. Thus, search/sort will be disabled for those columns. If you need them, use the `editColumn` api instead.

<a name="blade"></a>
## Add Column with Blade Syntax
Expand Down
10 changes: 5 additions & 5 deletions buttons-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Namespace configuration is used by the datatables command generator.
```

### DataTable Base Namespace/Directory
This is the base namespace/directory to be created when a new DataTable was called.
This directory is appended on default Laravel namespace.
This is the base namespace/directory to be created when a new DataTable is called.
This directory is appended to the default Laravel namespace.

**Usage:**
```php artisan datatables:make User```
Expand All @@ -24,16 +24,16 @@ This directory is appended on default Laravel namespace.
**Export filename:** ```users_(timestamp)```

### Model Option
This is the base namespace/directory where your model's are located.
This directory is appended on default Laravel namespace.
This is the base namespace/directory where your models are located.
This directory is appended to the default Laravel namespace.
**Usage:** ```php artisan datatables:make Post --model```
**Output:** ```App\DataTables\PostDataTable```
**With Model:** ```App\Post``
**Export filename:** ```posts_(timestamp)```

<a name="pdf-generator"></a>
## PDF Generator
Set the PDF generator to be used when converting your dataTable to pdf.
Set the PDF generator to be used when converting your dataTable to PDF.

Available generators are: `excel`, `snappy`

Expand Down
12 changes: 6 additions & 6 deletions buttons-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In this example, we will create a DataTable service class.
php artisan datatables:make Posts
```

This will create an `PostsDataTable` class on `app\DataTables` directory.
This will create a `PostsDataTable` class in the `app\DataTables` directory.

```php
namespace App\DataTables;
Expand Down Expand Up @@ -101,7 +101,7 @@ In this example, we will pass a `--model` option to set the model to be used by
php artisan datatables:make Posts --model
```

This will generate a `App\DataTables\PostsDataTable` class that uses `App\Post` as the base model for our query.
This will generate an `App\DataTables\PostsDataTable` class that uses `App\Post` as the base model for our query.
The exported filename will also be set to `posts_(timestamp)`.

```php
Expand Down Expand Up @@ -194,12 +194,12 @@ This will allow to use a non-standard namespace if front-end and back-end models

### Action Option

In this example, we will pass a `--action` option to set a custom path for the action column view.
In this example, we will use the `--action` option to set a custom path for the action column view.

```
php artisan datatables:make Posts --action="client.action"
```
If not provided, a default path will be used. It will needs to be changed thereafter.
If no path is provided, a default path will be used. It will need to be changed thereafter.

### Columns Option

Expand All @@ -208,13 +208,13 @@ In this example, we will pass a `--columns` option to set the columns to be used
```
php artisan datatables:make Posts --columns="id,title,author"
```
If not provided, a default set of columns will be used. It will needs to be manually changed thereafter.
If not provided, a default set of columns will be used. It will need to be manually changed thereafter.



## Creating a DataTable Scope service class

DataTable scope is class that we can use to limit our database search results based on the defined query scopes.
DataTable scope is a class that we can use to limit our database search results based on the defined query scopes.

```
php artisan datatables:scope ActiveUser
Expand Down
4 changes: 2 additions & 2 deletions buttons-custom.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Custom Actions

You can enable custom actions on your buttons, as follows:
You can enable custom actions on your buttons as follows:

Update `UsersDataTable` class and overload the `actions` property. Here we are
disabling the `csv` and `pdf` action (so they cannot be fired by hijacking the
disabling the `csv` and `pdf` actions (so they cannot be fired by hijacking their
request) and enabling a `myCustomAction`.


Expand Down