Skip to content
Discussion options

You must be logged in to vote

Repeatable sends the value as a json string. You can ovewrite the create() method in your CrudController, intercept the request and manualy validate and create the users.

Something along this lines (this is pseudo, not tested but should get you working..) :

use Illuminate\Support\Facades\Validator;
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation { store as traitStore; }

...

    public function store()
    {
        $this->crud->hasAccessOrFail('create');

        $users_to_add = json_decode(request()->get('your_repeatable_field'));

        foreach($users_to_add as $user) {
            Validator::make($user, ['email' => 'required|min:5', 'name' => 'required'])->validate

Replies: 0 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@lordjack
Comment options

Answer selected by astarialexi
Comment options

You must be logged in to vote
1 reply
@tabacitu
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants