I\'m trying to use one form for both creates and updates. Both actions save through this method:
public function store() {
$data = Input::all();
$dat
If you have all fields unguarded in your model, I think you can do it like this:
$feature = new Feature($data);
$feature->exists = Input::has('id');
$feature->save();
If you have some guarded fields, then you can unguard it first:
$feature = new Feature();
$feature->unguard();
$feature->fill($data);
$feature->exists = Input::has('id');
$feature->reguard();
$feature->save();
The reguard()
call is not actually needed if you don't do anything else with the model.