PHP code example of aliziodev / laravel-wilayah-logos

1. Go to this page and download the library: Download aliziodev/laravel-wilayah-logos 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/ */

    

aliziodev / laravel-wilayah-logos example snippets


// Setelah install, Province dan Regency auto dapat method logoUrl() dan logoPath()

$province = Province::where('code', '32')->first();

// URL logo untuk <img> tag
echo $province->logoUrl();        // PNG 1200px
echo $province->logoUrl('thumb'); // PNG 100px (thumbnail)

// Path absolut (untuk server-side usage)
echo $province->logoPath();
echo $province->logoPath('thumb');

// Contoh: Kab/Kota
$regency = Regency::where('code', '32.73')->first();
echo $regency->logoUrl();         // Logo Kota Bandung
bash
php artisan logos:publish

public/vendor/wilayah/logos/
├── prov/
│   ├── img/     ← PNG 1200px (32.png, 11.png, ...)
│   └── thumbs/  ← PNG 100px
└── kab/
    ├── 32/
    │   ├── img/     ← PNG 1200px (32.01.png, 32.73.png, ...)
    │   └── thumbs/
    └── ...