Applozic Basic Auth in PHP

public static function appLozicClient(): Client

    {

        $authorization = base64_encode(config('applozic.APPLOZIC_ID').':'.config('applozic.APPLOZIC_PASSWORD'));

        $client = new Client([

            'base_uri' => 'https://apps.applozic.com/rest/ws/',

            'headers'  => [

                'Apz-AppId' => config('applozic.APPLOZIC_APP_ID'),

                'Apz-Token' => 'Basic '.$authorization,

                'Content-Type' => 'application/json']

        ]);


        return $client;

    }



1 comment: