11
AugThe Country Codes package is a Composer plugin that provides an automated version of the Country Codes database. This database includes country, iso-codes, country names, country names with phone codes, phone codes as well an admin page to manage your list of data.
Also, my main reason to build this package was to send WhatsApp messages (specifically OTP codes).
The only thing you need to do to make this work is to add this package as a dependency to your project:
composer require irando/country-codes
Add following line in your config/app.php file
'providers' => [
// ...
Irando\CountryCodes\CountryCodesServiceProvider::class,
];
Run either of the commands below to publish package files
php artisan vendor:publish
And select id referred to:
Irando\CountryCodes\CountryCodesServiceProvider
OR
php artisan vendor:publish --tag=country-codes
Run this command to add countries table into your database
php artisan migrate
Next, Run this command to seed countries data into countries table.
php artisan db:seed --class=CountryCodesTableSeeder
Note: In case of error after this command run composer dumpautoload
and try again to seed database
Now visit your_url.tld/country-codes
and you are set.
If you need (probably you do!) to customize the look, routing, functionality, etc. of this package, at stage 2 of installation we deployed CountryCodes.php
which is your table model, as well as view files at resources/views/vendor/irando/country-codes
you can edit those files and create your own.
For more details, Please visit Github
Published at : 11-08-2022
I am a highly results-driven professional with 12+ years of collective experience in the grounds of web application development especially in laravel, native android application development in java, and desktop application development in the dot net framework. Now managing a team of expert developers at Codebrisk.
Launch project