title: How to provide unique user_id in profile factory in laravel
body: <p>since this &quot;new&quot; update came in laravel (laravel 8) I am struggling with factories. I need help on how to provide unique id from the User model to user_id column in profile factory. In my User model I have a relationship with profile:</p>
  <pre><code>public function profile()
  {
      return $this-&gt;hasOne(Profile::class);
  }
  </code></pre>
  <p>In profile model:</p>
  <pre><code>public function user()
  {
      return $this-&gt;belongsTo(User::class);
  }
  </code></pre>
  <p>And now I have to provide data to profile factory:</p>
  <pre><code> return [
          'user_id' =&gt; ,
          'image' =&gt; 'image',
          'bio' =&gt; $this-&gt;faker-&gt;sentence,
  ...
  </code></pre>