public function viewWithPayload()
    {
        return function (string $view, PayloadContract $payload, string $key = 'payload') {
            return ResponseFactory::view($view, [$key => $payload->getUnwrappedOutput()], $payload->getStatus());
        };
    }
public function viewWithPayload()
    {
        return function (string $view, PayloadContract $payload, string $key = 'payload') {
            return ResponseFactory::view($view, [$key => $payload->getUnwrappedOutput()], $payload->getStatus());
        };
    }
public function viewWithPayload ( ) { return function ( string $ view , PayloadContract $ payload , string $ key = 'payload' ) { return ResponseFactory :: view ( $ view , [ $ key => $ payload -> getUnwrappedOutput ( ) ] , $ payload -> getStatus ( ) ) ; } ; }
Response macro to send a response based on a payload.

@return mixed
Response macro to send a response based on a payload .