### Install Package via Composer Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Install the package using Composer. This command fetches and installs the latest version of the country-state-city package. ```bash composer require zalanihir/country-state-city ``` -------------------------------- ### Display Country Flags Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Iterate through all countries and display their corresponding flags using the package's seeded data. This example assumes flags are published and accessible. ```php use App\Models\Country; $countries = Country::all(); foreach ($countries as $country) { echo ''.$country->name.''; } ``` -------------------------------- ### Create a new branch for your fix or feature Source: https://github.com/zalanihir/country-state-city-package/blob/main/CONTRIBUTING.md Before starting work on an issue, create a new branch for your changes using Git. This helps keep your work organized and separate from the main codebase. ```bash git checkout -b main ``` -------------------------------- ### Run Migrations Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Run the package's migrations to create the necessary database tables for countries, states, and cities. This command sets up your database schema. ```bash php artisan migrate ``` -------------------------------- ### Run Database Seeders Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Execute the database seeders to populate your database with countries, states, and cities. This command runs all registered seeders, including the one for this package. ```bash php artisan db:seed ``` -------------------------------- ### Publish Package Files and Flags Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Publish the package's configuration files and flags using Artisan commands. This makes the package's assets accessible and configurable. ```bash php artisan vendor:publish --provider="Nihir\CountryStateCity\CountryStateCityServiceProvider" php artisan csc:publish-flags ``` -------------------------------- ### Register Service Provider (Laravel 9/10) Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Register the service provider in your `config/app.php` file if your Laravel version requires manual registration. This makes the package's functionality available. ```php \Nihir\CountryStateCity\CountryStateCityServiceProvider::class, ``` -------------------------------- ### Add Seeder Call to DatabaseSeeder Source: https://github.com/zalanihir/country-state-city-package/blob/main/README.md Include the `CountryStateCityTableSeeder` in your `DatabaseSeeder.php` file to seed the database with geographical data. This ensures the data is populated. ```php $this->call(CountryStateCityTableSeeder::class); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.