public function handleWebhook(Request $request)
    {
        $payload = json_decode($request->getContent(), true);
        $method = 'handle'.Str::studly(str_replace('.', '_', $payload['type']));

        if (method_exists($this, $method)) {
            return $this->{$method}($payload);
        }

        return $this->missingMethod();
    }
public function handleWebhook(Request $request)
    {
        $payload = json_decode($request->getContent(), true);
        $method = 'handle'.Str::studly(str_replace('.', '_', $payload['type']));

        if (method_exists($this, $method)) {
            return $this->{$method}($payload);
        }

        return $this->missingMethod();
    }
public function handleWebhook ( Request $ request ) { $ payload = json_decode ( $ request -> getContent ( ) , true ) ; $ method = 'handle' . Str :: studly ( str_replace ( '.' , '_' , $ payload [ 'type' ] ) ) ; if ( method_exists ( $ this , $ method ) ) { return $ this -> { $ method } ( $ payload ) ; } return $ this -> missingMethod ( ) ; }
Handle a Stripe webhook call.

@param  \Illuminate\Http\Request  $request
@return \Symfony\Component\HttpFoundation\Response
Handle a Stripe webhook call .