Php Laravel 4雄辩的质量分配-修改输入

Php Laravel 4雄辩的质量分配-修改输入,php,laravel,laravel-4,eloquent,Php,Laravel,Laravel 4,Eloquent,我有点受不了大规模的任务。我有一个输入字段datepicker,它需要在将strtotime函数插入数据库之前获得修改并应用它 在使用质量分配时,有没有办法做到这一点 class Customer extends Ardent { protected $table = 'customers'; public $autoPurgeRedundantAttributes = true; public $autoHydrateEntityFromInput = true;

我有点受不了大规模的任务。我有一个输入字段datepicker,它需要在将strtotime函数插入数据库之前获得修改并应用它

在使用质量分配时,有没有办法做到这一点

class Customer extends Ardent {
    protected $table = 'customers';
    public $autoPurgeRedundantAttributes = true;
    public $autoHydrateEntityFromInput = true;   
    public $forceEntityHydrationFromInput = true; 


    protected $fillable = array(

        'email',
    );
}

如果您只需要更改输入,可以执行以下操作:

$input = Input::all();

$input['date'] = strtotime($input['date']);

Input::replace($input);

是的,这是可能的,但请告诉我们到目前为止你做了什么,我们有了一个起点。嗯,不确定我应该给你看什么。这是一个简单而雄辩的模型,没有多少东西可以展示。我更新了我的问题。谢谢您计划在哪里修改该输入字段?在你的控制器里?向我们展示您的控制器以及如何在数据库中插入内容,是否使用create?可能吧,但我们怎么能确定呢?这个问题太广泛了。这取决于我们是想更新客户还是创建新客户。我们使用保存功能。如果我们可以直接在模型或控制器中修改输入,那就可以了。两者都很好。