title: Trying to get property of non-object when using view share in Laravel
body: <p>I have some view like this:</p>
  
  <pre><code>return view('admin.users.profile')-&gt;with('user',User::find(Auth::user()-&gt;id));
  </code></pre>
  
  <p>I decide to user View::Share so i don't have to use with in every view. So i put in my AppServicesProvider like this:</p>
  
  <pre><code>    View::share('user',User::find(Auth::user()-&gt;id));
  </code></pre>
  
  <p>and it give me an errors: </p>
  
  <pre><code>"Trying to get property of non-object"
  </code></pre>
  
  <p>so what can be wrong? i have no problem when i'm using it in my view but using ->with. Thanks.</p>