title: Object could not be converted to strings
body: <p>My query causes: <code>Object of class Illuminate\Database\Eloquent\Builder could not be converted to string</code>. When I replace <code>$uname</code> with a hardcoded name <code>'Dennis'</code> in the model-query then the error disappears. I checked whether the session variable (<code>'username'</code>) was empty and causing the error but it is set. Thanks for any hint.</p>
  
  <p>Controller:</p>
  
  <pre><code>$username = Session::get('username');
  $data['users'] = Profile::GetUserData($username);
  $users = Profile::GetUserData();
  
  return View::make('profile_view', $data);
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>class Profile extends Eloquent{
      public function scopeGetUserData($uname){
          return DB::table('users')-&gt;where('user_name', '=', $uname)-&gt;first();
          //return DB::table('users')-&gt;where('user_name', '=', 'Dennis')-&gt;first();
      }
  }
  </code></pre>