Skip to content
Discussion options

You must be logged in to vote

Hi @iAdil

First of all, I'm not experienced to use the relationship field type, but what I got from your question I can say that, we can try these steps

  1. get all of the relationship's id
//inside UserUpdateCrudRequest 
$id = $this->get('id') ?? request()->route('id');
$getCodes = User::with('codes')->where('id', $id)->get()->pluck('codes.id', 'id');
  1. We use Rule Validation inside our Request
//inside UserUpdateCrudRequest , also don't forget to import the Rule Validation Class
use Illuminate\Validation\Rule; // put this

$id = $this->get('id') ?? request()->route('id');
$getCodesId = User::with('codes')->where('id', $id)->get()->pluck('codes.id', 'id');
return [
'codes.*.number' => [
  …

Replies: 1 comment

Comment options

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