title: Attempt to read property “client_name” on null
body: <p>Context: I am not familiar with PHP and was left to spin up an environment since the previous dev left.</p>
  <p>I am getting the error in my <code>resources\views\layouts\app.blade.php</code></p>
  <pre><code> &lt;div class=&quot;user-wrapper&quot;&gt;
              &lt;img class=&quot;user-img&quot; src=&quot;{{ asset('images/user-circle.svg')}}&quot; alt=&quot;User&quot;/&gt;
              &lt;div class=&quot;user-info&quot;&gt;
                &lt;h3&gt;{{ Auth::user()-&gt;name}}&lt;/h3&gt;
                &lt;p&gt; {{ Auth::user()-&gt;email}}&lt;/p&gt;
                &lt;p&gt; {{ Auth::user()-&gt;client-&gt;client_name}}&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  </code></pre>
  <p>Here is my Client model</p>
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Database\Eloquent\Factories\HasFactory;
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  
  class Client extends Model
  {
      use HasFactory;
      use SoftDeletes;
  
      protected $fillable = [
        'client_name',
        'description',
      ];
  }
  </code></pre>
  <p>And the User Model</p>
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Contracts\Auth\MustVerifyEmail;
  use Illuminate\Database\Eloquent\Factories\HasFactory;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Illuminate\Notifications\Notifiable;
  
  class User extends Authenticatable
  {
      use HasFactory, Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name',
          'email',
          'password',
          'client_id',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password',
          'remember_token',
      ];
  
      /**
       * The attributes that should be cast to native types.
       *
       * @var array
       */
      protected $casts = [
          'email_verified_at' =&gt; 'datetime',
      ];
  
      
      public function client(){
        return $this-&gt;hasOne(Client::class, 'id', 'client_id');
      }
  }
  
  </code></pre>
  <p>I can get the name and email from my database just fine but for the client it somehow returns null. I have also verified that I can get the data from the client tables.</p>
  <p>EDIT:
  I added the following lines in Client Model as suggested but I still get the</p>
  <pre><code> public function client(){
        return $this-&gt;hasOne(Client::class, 'client_id', 'id');
      }
  </code></pre>