Skip to content

Commit 263188f

Browse files
committed
Compete configurations.
1 parent c1bb2cb commit 263188f

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

general-settings.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,73 @@ Default fractal serializer to be used when serializing the response.
8383
```php
8484
'serializer' => League\Fractal\Serializer\DataArraySerializer::class,
8585
```
86+
<a name="script-template"></a>
87+
## Script Template
88+
DataTables html builder script blade template.
89+
If published, the file will installed on `resources/views/vendor/datatables/script.blade.php`.
90+
91+
```php
92+
'script_template' => 'datatables::script',
93+
```
94+
95+
<a name="console"></a>
96+
## Artisan Console Configurations
97+
Namespace configuration is used by the datatables command generator.
98+
99+
```php
100+
'namespace' => [
101+
'base' => 'DataTables',
102+
'model' => '',
103+
],
104+
```
105+
106+
### DataTable Base Namespace/Directory
107+
This is the base namespace/directory to be created when a new DataTable was called.
108+
This directory is appended on default Laravel namespace.
109+
110+
**Usage:**
111+
```php artisan datatables:make User```
112+
113+
**Output:**
114+
```App\DataTables\UserDataTable```
115+
116+
**Export filename:** ```users_(timestamp)```
117+
118+
### Model Option
119+
This is the base namespace/directory where your model's are located.
120+
This directory is appended on default Laravel namespace.
121+
**Usage:** ```php artisan datatables:make Post --model```
122+
**Output:** ```App\DataTables\PostDataTable```
123+
**With Model:** ```App\Post``
124+
**Export filename:** ```posts_(timestamp)```
125+
126+
## PDF Generator
127+
Set the PDF generator to be used when converting your dataTable to pdf.
128+
129+
Available generators are: `excel`, `snappy`
130+
131+
### Excel Generator (Default Generator)
132+
When `excel` is used as the generator, the package will use [`maatwebsite/excel`](http://www.maatwebsite.nl/laravel-excel/docs) to generate the PDF.
133+
134+
> To export files to pdf, you will have to include "dompdf/dompdf": "~0.6.1", "mpdf/mpdf": "~5.7.3" or "tecnick.com/tcpdf": "~6.0.0" in your composer.json and change the export.pdf.driver config setting accordingly.
135+
136+
### Snappy Generator
137+
When `snappy` is used as the generator, you need to install [`barryvdh/laravel-snappy`](https://github.com/barryvdh/laravel-snappy)
138+
139+
### Snappy PDF Options
140+
These are the options passed to `laravel-snappy` when exporting the pdf file.
141+
142+
```php
143+
'snappy' => [
144+
'options' => [
145+
'no-outline' => true,
146+
'margin-left' => '0',
147+
'margin-right' => '0',
148+
'margin-top' => '10mm',
149+
'margin-bottom' => '10mm',
150+
],
151+
'orientation' => 'landscape',
152+
],
153+
```
154+
86155

0 commit comments

Comments
 (0)