PHP code example of gheith3 / omancities

1. Go to this page and download the library: Download gheith3/omancities 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/ */

    

gheith3 / omancities example snippets


$governorate = OmanGovernorate::first();
$governorate->load("cities");
echo $governorate->name;

//$city = OmanCity::find(10);
$city = $governorate->cities()->first();
echo $city->name;

echo $governorate->name;

echo $governorate->getTranslation("name", "ar");
echo $governorate->getTranslation("name", "en");

echo $city->getTranslation("name", "ar");
echo $city->getTranslation("name", "en");
bash
php artisan vendor:publish --tag="omancities-migrations"
php artisan migrate
bash
php artisan omancities:seed