Error handling on a query not working in controller laravel
<p>I am trying to simple error handling whereby if  a query doesn't return anything I want to redirect the user to a 404 page, but for now I just echoing a message to see if it triggers, here is my code</p>

<pre><code>public function show($user_id, $username) {

    $user = User::where('id', $user_id)-&gt;where('name', $username)-&gt;get();

    if (count($user = 0)) {
        echo "REEEEEEE";
    }
    else 
    {
        $user-&gt;load('comments.users', 'posts.users');

        return $user;
    }
    //return view ('users.show', compact('user'));

}
</code></pre>

<p>This only echos the message and doesn't load the relationships or return the user if the query returns something, am I doing something wrong?</p>