Download the PHP package digitlimit/flag without Composer

On this page you can find all versions of the php package digitlimit/flag. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flag

πŸ‡ΊπŸ‡Έ digitlimit/flag

Latest Version on Packagist Build Status Total Downloads

digitlimit/flag is a simple Laravel package that provides Blade and Livewire components for displaying SVG country flags in 1x1 (square) or 4x3 (rectangular) aspect ratios.

It comes bundled with a collection of country flag SVGs and makes rendering them as easy as using a Blade component.


πŸš€ Installation

Require the package using Composer:

No need to publish anything β€” the package auto-discovers and registers itself.

🧩 Usage

The package provides Blade components for every country using ISO 3166-1 alpha-2 codes.

βœ… Basic Usage

🎨 Custom Classes (e.g., Tailwind CSS)

You can apply custom classes to style the flags:

πŸ“ Available Aspect Ratios

1x1: Square flags 4x3: Traditional rectangular flags

πŸ§ͺ Example Usage

🌍 Supported Countries

All ISO 3166-1 alpha-2 country codes are supported (e.g., us, ng, gb, fr, de, etc.).

The flag assets are stored in:

Refer to this Wikipedia page for a full list of valid codes.

πŸ“¦ Asset Publishing (Optional)

If you want to customize or reference the SVG files directly:

The files will be published to your public/vendor/flag directory.

❓ FAQ

Q: What if a flag doesn’t show up?

Make sure: You’re using a valid ISO alpha-2 country code. The country code is lowercase (e.g., ng, us, de, not NG or Us).

Q: Can I use this in Livewire components? Yes! Blade components work seamlessly in Livewire views.

Q: Will this work with Tailwind CSS? Absolutely. Pass any Tailwind or custom class names via the class attribute.

πŸ§ͺ Testing

To run the tests:

Or with Pest:

πŸ› οΈ Contributing

Contributions are welcome! Please fork this repository and submit a pull request:

πŸ“„ License

This package is open-sourced software licensed under the MIT license.


All versions of flag with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
php Version ^8.2
laravel/framework Version ^10.0 || ^11.0 || ^12.0
livewire/livewire Version ^2.12 || ^3.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package digitlimit/flag contains the following files

Loading the files please wait ...