PHP code example of xtrics / azure-url-generator

1. Go to this page and download the library: Download xtrics/azure-url-generator 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/ */

    

xtrics / azure-url-generator example snippets




namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Xtrics\AzureUrlGenerator\Generator;

class VirtualMachineController extends Controller
{
    public function generateUrl()
    {
        $vmName = 'test';
        $apiVersion = '2021-01-01';
        $str = Generator::generateUrl('get_single_vm', [
            'subscription-id' => config('azure.subscription_id'),
            'resource-group' => config('azure.resource_group'),
            'vm-name' => $vmName,
            'api-version' => $apiVersion
        ]);

        echo $str;
    }
}

bash
php artisan vendor:publish --provider "Xtrics\AzureUrlGenerator\GeneratorServiceProvider"
config/azure.php
config/azure.php