定制 open-afghanistan/provinces 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

open-afghanistan/provinces

最新稳定版本:1.0.3

Composer 安装命令:

composer require open-afghanistan/provinces

包简介

Afghanistan provinces laravel package

README 文档

README

Latest Version on Packagist Total Downloads Repo Size Repo Size

Introduction:

The Laravel package "provinces" provides essential resources for managing Afghanistan's provinces and districts within your Laravel application. This package includes models, migrations, seeders, and factories to facilitate the integration of Afghanistan's administrative divisions into your project.

Requirements:

To use this package, ensure your Laravel application meets the following requirements:

  • PHP 8.1 or higher
  • Laravel 9 or higher

Installation:

You can effortlessly install the "provinces" package using Composer. Open your terminal and run the following command:

composer require open-afghanistan/provinces

Migrations:

After successful installation, you need to publish the migration files. Use the following Artisan command:

php artisan vendor:publish --tag=provinces-migration

This command will generate a migration file that sets up the necessary tables for provinces and districts in your database.

Seeders:

The package includes a handy ProvincesSeeder that populates all 34 Afghanistan provinces along with their respective districts. You can call this seeder in your project's database seeder file as follows:

// DatabaseSeeder.php

use OpenAfghanistan\Provinces\Database\Seeders\ProvincesSeeder;

$this->call(ProvincesSeeder::class);

If you only wish to seed specific provinces, you can call their individual seeder classes:

// DatabaseSeeder.php

use OpenAfghanistan\Provinces\Database\Seeders\KabulProvinceSeeder;

$this->call(KabulProvinceSeeder::class);

Factories:

To facilitate testing, this package provides factories for both provinces and districts. You can create instances of these models in your tests with ease:

For provinces:

use OpenAfghanistan\Provinces\Models\Province;

Province::factory()->create();

For districts:

use OpenAfghanistan\Provinces\Models\District;

District::factory()->create();

Contribution Guide:

We welcome contributions to enhance this package. If you'd like to contribute by adding districts to any province, specific seeder files are available for each province to simplify the process. Please run the ./vendor/bin/pint command before you push any piece of code.

License:

The "provinces" package is open-source software distributed under the MIT License. You are free to use and modify it to suit your project's requirements.

Feel free to utilize this package to manage Afghanistan's administrative divisions effortlessly in your Laravel application.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固