Redirect and pass data from controller
<p>I want to redirect from a controller and pass data;</p>

<pre><code> public function fortest(Request $request)
{
     $user = DB::table('user2s')-&gt;where('name', $request-&gt;name)-&gt;first();
     if (isset($user))
     {   
        return redirect('/fortest2', ['user'=&gt;$user]);//compact('user'));
        //return $this-&gt;fortest2($request);
     }
}
public function fortest2(Request $request)
{
    return $request-&gt;name;
}

Route::get('/fortest', 'UserController@fortest');
Route::get('/fortest2/', 'UserController@fortest2');
</code></pre>

<p>The code works when calling the controller directly from within the controller. The data type has a model. How can I accomplish this?</p>