zofe / rapyd-laravel

deprecated rewritten in rapyd-livewire
MIT License
866 stars 297 forks source link

Can new entity row or id after DataForm is saved? #400

Open lautinghang opened 7 years ago

lautinghang commented 7 years ago

$form->passed(function() use ($form) { // Here can I get the entity row or id that just create in database?? ??????

    $form->message("DataForm Submitted");
    $form->link("/","Next Step");
});
Leoncio-Abreu commented 7 years ago

You can get it this way. Just replace Model as $modal with your model name.

$form->passed(function() use ($form) { Model::created(function ($model){ $id=$model->id; ...... }); });