Laravel - Responses - Generating Cookie Instances

If you would like to generate a Symfony\Component\HttpFoundation\Cookie instance that can be attached to a response instance at a later time, you may use the global cookie helper. This cookie will not be sent back to the client unless it is attached to a response instance:

    
    $cookie = cookie('name', 'value', $minutes);
    
    return response('Hello World')->cookie($cookie);