PHP code example of revealit / laravel-azure-sdk

1. Go to this page and download the library: Download revealit/laravel-azure-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

revealit / laravel-azure-sdk example snippets


return [

    /*
     * The Application (client) ID
     */
    "client_id" => "",

    /*
     * Directory (tenant) ID
     */
    "tenant_id" => "",

    /*
     * The apps secret value. This value is only visible immediately after creation,
     * so be sure to note it down.
     */
    "client_secret_value" => ""
    
    /*
     * The default service bus to use.
     */
    "default_service_bus_namespace" => ""

];


use Revealit\AzureSdk\Facades\AzureSdk;

// Define an array
$message = [
    "title" => "Hello World!"
];

// Send a message to a queue
return AzureSdk::pushToQueue("test_queue", $message)->status();

use Revealit\AzureSdk\Facades\AzureSdk;

// Send a message to a queue in a different service bus
return AzureSdk::pushToQueue("test_queue", ["msg" => "Hello World!"], "different_service_bus")->status();

use Revealit\AzureSdk\Facades\AzureSdk;

$token = AzureSdk::getAPIToken();
$serviceBus = config("azure-sdk.default_service_bus_namespace");
$message1 = ["url" => "https:www.github.com"];

// Send messages to different queues using the same token
AzureSdk::pushToQueue("test_queue", $message1, $serviceBus, $token)->status();
AzureSdk::pushToQueue("test_queue_2", ["title" => "Azure SDK"], $serviceBus, $token)->status();
bash
php artisan vendor:publish