Skip to content

Commit ca2e542

Browse files
committed
added config file and updated read me
1 parent eb47566 commit ca2e542

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

README.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,17 @@ Composer will download the package. After package downloaded, open "app/config/a
3131
),
3232

3333

34-
34+
3535
'aliases' => array(
3636
...
3737
'Datatables' => 'Bllim\Datatables\Datatables',
3838
),
3939

40+
Finally you need to publish a configuration file by running the following Artisan command.
41+
42+
```php
43+
$ php artisan config:publish bllim/datatables
44+
```
4045

4146
### Usage
4247

@@ -49,7 +54,7 @@ It is better, you know these:
4954
- You can remove any column by using remove_column($column) method
5055
- You can add columns by using add_column($column_name, $content, $order)
5156
- You can use Blade Template Engine in your $content values
52-
- The name of columns is set by returned array.
57+
- The name of columns is set by returned array.
5358
- That means, for 'posts.id' it is 'id' and also for 'owner.name as ownername' it is 'ownername'
5459

5560

@@ -72,18 +77,18 @@ It is better, you know these:
7277
->add_column('operations','<a href="{{ URL::route( \'admin.post\', array( \'edit\',$id )) }}">edit</a>
7378
<a href="{{ URL::route( \'admin.post\', array( \'delete\',$id )) }}">delete</a>
7479
')
75-
->edit_column('status','@if($status)
76-
Active
77-
@else
78-
Passive
80+
->edit_column('status','@if($status)
81+
Active
82+
@else
83+
Passive
7984
@endif')
8085
// you can also give a function as parameter to edit_column and add_column instead of blade string
8186
->edit_column('ownername','Author of this post is {{ $ownername }}')
8287
->remove_column('id')
8388
->make();
8489

85-
**Notice:** If you use double quotes while giving content of add_column or edit_column, you should escape variables with backslash (\) else you get error. For example:
86-
90+
**Notice:** If you use double quotes while giving content of add_column or edit_column, you should escape variables with backslash (\) else you get error. For example:
91+
8792
edit_column('id',"- {{ \$id }}") .
8893

8994

src/config/datatables.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
return array(
4+
5+
'search' => array(
6+
'case_insensitive' => true,
7+
'use_wildcards' => false,
8+
)
9+
10+
);

0 commit comments

Comments
 (0)