title: Argument passed to (Symfony) Response::setContent() must be of the type string or null, object given
body: <p>I try to sign up by Facebook, using Laravel 7 and package (Socialite), when press on the URL:</p>
  <pre><code>&lt;div class=&quot;form-group row mb-0&quot;&gt;
       &lt;div class=&quot;col-md-6 offset-md-4&quot;&gt;
            &lt;a href=&quot;{{url('redirect/facebook')}}&quot;&gt;login with your facebook account&lt;/a&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>The redirect page runs the app, i created in facebook developers as the img:</p>
  <p><a href="https://i.stack.imgur.com/DJfoa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DJfoa.jpg" alt="enter image description here" /></a></p>
  <p>when press (continue as Mahmoud) and put my email and pass this error shows:</p>
  <p>TypeError
  Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given, called in C:\wamp64\www\Starter\vendor\laravel\framework\src\Illuminate\Http\Response.php on line 65</p>
  <p>and URL upove chrom box the following:</p>
  <pre><code>http://localhost:8000/callback/facebook?code=AQDlnu6qDKxTV6nG_vN4DYMKSyVP-zEKTL_uJDKbENBTc-pBwtIxpLRkcUS_zebL3nbPo8RjKKC3D_UbZkHM8dz5iZU8c4-PPPdyS_teoLZZ77kVf1pLGCx0ggTwx0EJys8nK3aPE8BugkbgcXTFUt7qcDxQcX1ptlmG9_0qSbuifaEg678bl71Gbm3qU5Jx-_ZsonmuadY3kHTbq8vG-3s2jqV4KkxDSCw-m-4LrIe46v73EXFzG1wFNMbkWB4MJay5ZewPjI2ah3p8o5FCgGLp1Rs4clsKW5B2fQyoWc6MM-Ut2jESoQ7YMOjZpuX5kA1aWP3To1TncAjKpWsAevIa&amp;state=n0XP5Kf68IZlOUqm1pwUYryb9md9nHCdSnatvbpO#_=_
  </code></pre>
  <p>my Routes:</p>
  <pre><code>Route::get('/redirect/{service}','SocialiteController@redirect');
  Route::get('/callback/{service}','SocialiteController@callback');
  </code></pre>
  <p>Controller:</p>
  <pre><code>    &lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Laravel\Socialite\Facades\Socialite;
  
  class SocialiteController extends Controller
  {
      public function redirect($service){
          return Socialite::driver($service)-&gt;redirect();
  
      }
      public function callback($service){
  
           $user = Socialite::with($service) -&gt; user();
           return $user;
  
      }
  
  }
  </code></pre>
  <p>.env:</p>
  <pre><code>FB_CLIENT_ID = XXX
  FB_CLIENT_SECRET = XXX
  FB_REDIRECT = 'http://localhost:8000/callback/facebook'
  </code></pre>
  <p>config/services.php:</p>
  <pre><code> 'facebook' =&gt; [
      'client_id' =&gt; env ('FB_CLIENT_ID'),
      'client_secret' =&gt; env ('FB_CLIENT_SECRET'),
      'redirect' =&gt; env ('FB_REDIRECT')
  ],
  </code></pre>
  <p>in config/app.php i added:</p>
  <pre><code>Laravel\Socialite\SocialiteServiceProvider::class,
  </code></pre>
  <p>and</p>
  <pre><code>'Socialite' =&gt; Laravel\Socialite\Facades\Socialite::class,
  </code></pre>