codepil0t/laravel-country-flags 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codepil0t/laravel-country-flags

最新稳定版本:1.0.0

Composer 安装命令:

composer require codepil0t/laravel-country-flags

包简介

A Laravel package for country flags

README 文档

README

GitHub License: MIT

This package provides country flags for Laravel applications (compatible with Laravel 8+ up to Laravel 12).

Installation

Install via Composer:

composer require codepil0t/laravel-country-flags

Publishing Assets

Publish the flag assets to your public directory:

php artisan vendor:publish --tag=flags

This will copy the flags to public/flags/.

Usage

In Blade Templates

Use the @flag directive:

<img src="@flag('de')" alt="Germany Flag">

Or use the helper function:

<img src="{{ flag_url('de') }}" alt="Germany Flag">

You can specify the aspect ratio (1x1 or 4x3, default is 4x3):

<img src="{{ flag_url('de', '1x1') }}" alt="Germany Flag">

In PHP

echo flag_url('de'); // /flags/4x3/de.svg

Supported Countries

All ISO 3166-1 alpha-2 country codes are supported.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-20