Adding Carbon support
This commit is contained in:
1 parent
3cd9e81140
commit
d5618c3b22
2 files changed
+12
-4
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<?php namespace Collective\Html;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Routing\UrlGenerator;
|
||||
use Illuminate\Session\Store as Session;
|
||||
use Illuminate\Support\Traits\Macroable;
|
||||
@@ -321,6 +322,11 @@ class FormBuilder {
|
||||
*/
|
||||
public function date($name, $value = null, $options = array())
|
||||
{
|
||||
if ($value instanceof Carbon)
|
||||
{
|
||||
$value = $value->format('Y-m-d');
|
||||
}
|
||||
|
||||
return $this->input('date', $name, $value, $options);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user