title: Laravel 5.6 - "Trying to get property of non-object"
body: <p>I'm running a test in my controller just to make sure I get a output. Unfortunately, I get a &quot;Trying to get property of non-object&quot; error. I just want to see the name field displayed as per code below.</p>
  <p>Here's my Model (Member.php):</p>
  <pre><code>namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Member extends Model
  {
      //
  }
  </code></pre>
  <p>Here's my MemberController.php file:</p>
  <pre><code>public function show($id)
      {
          $data = array();
          $data['id'] = $id;
          $member = Member::find('$id'); 
  
          //Test
          echo $member-&gt;name;
          exit;
  
          return view('members/show', $data); 
      }
  </code></pre>
  <p>This is my Route:</p>
  <pre><code>Route::get('members/{member}', 'MemberController@show');
  </code></pre>
  <p>This is my schema where the table is named members and the name field is defined:
  <a href="https://i.stack.imgur.com/VV5i4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VV5i4.png" alt="enter image description here" /></a></p>
  <p>Like I said, when I run my url at Some_url/members/1 I get a &quot;Trying to get property of non-object&quot; error</p>
  <p>Where am I going wrong?</p>