title: Error "Property [nom] does not exist on this collection instance" in Laravel
body: <p>I have two tables, <code>user</code> and <code>technicien</code>, with a one to one relation. When I edit a technicien using my form "Modifier Techicien" below I want the form to be autofilled with current information from both tables user and technicien.</p>
  
  <p>At this time the form is autofilled with only information from technicien.</p>
  
  <p><a href="https://i.stack.imgur.com/2vtWD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2vtWD.png" alt="enter image description here"></a></p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>public function edit($id)
  {
      $technicien=technicien::find($id);
      $users = user::orderBy('id', 'asc')-&gt;get();
      return view('technicien.edit',['moyenne_avis'=&gt;$technicien],
  ['actif'=&gt;$technicien],['user_id'=&gt;$technicien])-
  &gt;with('users',$users);
  }
  
  public function update(Request $request, $id)
  {
      // do some request validation
      $technicien=technicien::find($id);
      $technicien-&gt;update($request-&gt;all());
      return redirect('technicien');
  }
  </code></pre>
  
  <p><strong>edit.blade.php</strong></p>
  
  <pre><code>@extends('Layouts/app')
  @extends('Layouts.master')
  @section('content')
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-10"&gt;
              &lt;h1&gt;Modifier Technicien&lt;/h1&gt;
          &lt;form action="{{ route('technicien.update', $actif-&gt;id , $moyenne_avis-&gt;id , $users-&gt;nom , $users-&gt;prenom) }}" method="post"&gt;
          {{csrf_field()}}
          {{ method_field('PATCH') }}
  
  
              &lt;div class="form-group"&gt;
                  &lt;label for=""&gt;Nom&lt;/label&gt;
                  &lt;input id="nom" type="text" class="form-control" name="nom" value="{{$nom-&gt;nom}}" &gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for=""&gt;Prenom&lt;/label&gt;
                  &lt;input id="nom" type="text" class="form-control" name="nom" value="{{$prenom-&gt;prenom}}" &gt;
              &lt;/div&gt;
  
              &lt;div class="form-group"&gt;
                  &lt;label for=""&gt;moyenne Avis&lt;/label&gt;
                  &lt;input type="text"  name ="moyenne_avis" class="form-control" value ="{{$moyenne_avis-&gt;moyenne_avis}}" &gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for=""&gt;Etat Technicien&lt;/label&gt;
                  &lt;input type="text"  name ="actif" class="form-control" value ="{{$actif-&gt;actif}}" &gt;
              &lt;/div&gt;
  
  
  
              &lt;div class="form-group"&gt;
  
                  &lt;input type="submit" value = "enregistrer" class="form-control btn btn-primary"&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  </code></pre>