Redirect::route('profile') and with() in laravel

PHP
// For a route with the following URI: profile/{id}

return redirect()->route('profile', [$user]);// For a route with the following URI: profile/{id}

return redirect()->route('profile', ['id' => 1]);
Source

Also in PHP: