1. Go to this page and download the library: Download altwaireb/laravel-world 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/ */
altwaireb / laravel-world example snippets
public function run(): void
{
$this->call(WorldTableSeeder::class);
...
}
use App\Models\Country;
$sa = Country::getByIso2('SA');
$sa->name; // Saudi Arabia
$sa->iso2; // SA
$sa->iso3; // SAU
$sa->currency_symbol; // ﷼
$sa->native; // المملكة العربية السعودية
use App\Models\Country;
$bra = Country::getByIso3('BRA');
$bra->name; // Brazil
$bra->iso2; // BR
$bra->iso3; // BRA
$bra->currency_symbol; // R$
$bra->native; // Brasil
use App\Models\Country;
$bra = Country::getByCode('PT');
$bra->name; // Portugal
$bra->iso2; // PT
$bra->iso3; // PRT
$bra->currency_symbol; // €
$bra->native; // Portugal
use App\Models\Country;
$countries = Country::active()->pluck('name','id');
bash
php artisan world:install
bash
php artisan world:seeder
bash
php artisan world:seeder --refresh
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.