Download the PHP package alrez/iran-states without Composer

On this page you can find all versions of the php package alrez/iran-states. 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 iran-states

پکیج استان‌ها و شهرهای ایران برای لاراول

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PHP Version](https://img.shields.io/badge/php-%3E%3D8.2-8892BF.svg)](https://www.php.net/) [![Laravel Version](https://img.shields.io/badge/laravel-11%20%7C%2012-FF2D20.svg)](https://laravel.com) ## درباره پکیج این پکیج برای مدیریت استان‌ها و شهرهای ایران در فریم‌ورک لاراول طراحی شده است. با استفاده از این پکیج می‌توانید به راحتی به لیست استان‌ها و شهرهای ایران دسترسی داشته باشید. ## ویژگی‌های جدید - سازگار با Laravel 11 و 12 - Seeder بهینه شده با استفاده از chunk(1000) - دو trait جدید برای مدیریت روابط - Service بهینه شده با cache بهتر - Type hints کامل برای PHP 8.2+ ## نصب برای نصب از طریق کامپوزر: سپس برای نصب جداول و داده‌های پایه: این دستور به صورت خودکار مایگریشن‌ها را اجرا کرده و داده‌های پایه را در دیتابیس وارد می‌کند. ## انتشار فایل‌های پکیج (اختیاری) برای انتشار فایل کانفیگ: ## استفاده ### مدل‌ها با Traits جدید #### مدل City با InteractWithState #### مدل State با InteractWithStates ### استفاده از Traits در مدل‌های شخصی #### برای مدل‌هایی که به یک استان تعلق دارند #### برای مدل‌هایی که با چندین استان کار می‌کنند ### سرویس بهینه شده ### قوانین اعتبارسنجی ## نکات عملکرد ### Cache - تمام عملیات اصلی cache شده‌اند (24 ساعت) - برای پاک کردن cache از `clearCache()` استفاده کنید - عملیات جستجو cache نمی‌شوند ### انتخاب متد مناسب - برای dropdown کامل: `getAllStatesWithCities()` - برای یک استان خاص: `getStateById()` - برای شهرهای یک استان: `getCitiesByStateId()` - برای عملیات چندتایی: `getStatesByIds()` یا `getCitiesByStateIds()`

Iran States Package for Laravel

License PHP Version Laravel Version

About

This package provides a comprehensive solution for managing Iran's states and cities in Laravel applications. It offers easy access to a complete list of Iran's states and their corresponding cities with improved performance and modern Laravel features.

New Features

Installation

Install via Composer:

Then install the tables and seed the data:

This command will automatically run the migrations and seed the database with the initial data using optimized chunked insertion.

Publishing Package Files (Optional)

To publish the config file:

Usage

Models with New Traits

City Model with InteractWithState

State Model with InteractWithStates

Using Traits in Your Own Models

For models that belong to a single state

For models that work with multiple states

Enhanced Service

Validation Rules

Performance Notes

Caching

Choosing the Right Method

Requirements

License

MIT License. Please see License File for more information.


All versions of iran-states with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0|^12.0
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 alrez/iran-states contains the following files

Loading the files please wait ....