Skip to content

Commit e401414

Browse files
committed
Use constant for column argument
1 parent 1efb8c9 commit e401414

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The filter takes up to three arguments to customize it to your needs.
5959
<td>Column</td>
6060
<td>String</td>
6161
<td>The name of the database column on which the selected date range should be applied to.</td>
62-
<td>"created_at"</td>
62+
<td>Illuminate\Database\Eloquent\Model::CREATED_AT</td>
6363
</tr>
6464
<tr>
6565
<td>Settings</td>

src/DateRangeFilter.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Carbon\Carbon;
66
use Illuminate\Database\Eloquent\Builder;
7+
use Illuminate\Database\Eloquent\Model;
78
use Illuminate\Http\Request;
89
use InvalidArgumentException;
910
use Laravel\Nova\Filters\Filter;
@@ -26,7 +27,7 @@ class DateRangeFilter extends Filter
2627
*/
2728
protected $column;
2829

29-
public function __construct(string $name = 'Created at', string $column = 'created_at', array $config = [])
30+
public function __construct(string $name = 'Created at', string $column = Model::CREATED_AT, array $config = [])
3031
{
3132
$this->name = $name;
3233
$this->column = $column;

0 commit comments

Comments
 (0)