tomatophp/filament-locations 问题修复 & 功能扩展

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

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

tomatophp/filament-locations

最新稳定版本:4.0.0

Composer 安装命令:

composer require tomatophp/filament-locations

包简介

Database Seeds for Countries / Cities / Areas / Languages / Currancy with ready to use resources for FilamentPHP

README 文档

README

Screenshot

Filament Locations

Dependabot Updates PHP Code Styling Tests Latest Stable Version License Downloads

A database of countries, cities, area, languages, currenacy with json base and database base for FilamentPHP

Screenshots

Countires Edit Countires Languages Currency Locaitons

Installation

composer require tomatophp/filament-locations

after install your package please run this command

php artisan filament-locations:install

finally reigster the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\TomatoPHP\FilamentLocations\FilamentLocationsPlugin::make())

Disable Setting Hub

to disable the setting hub you can use this method

->plugin(\TomatoPHP\FilamentLocations\FilamentLocationsPlugin::make()->settingsHub(false))

Disable Resources

to disable the resources you can use this method

->plugin(
\TomatoPHP\FilamentLocations\FilamentLocationsPlugin::make()
    ->countries(false)
    ->languages(false)
    ->currency(false)
    ->locations(false)
)

Use Database Driver

to use database driver or if you don't have "sqlite" on your app, you can change the driver on config to "database" first publish the config

php artisan vendor:publish --tag="filament-locations-config"

after that go to config/filament-locations.php and change the driver to "database"

    'driver' => 'database'

now you need to run migration

php artisan migrate

now load the data to seeder

php artisan filament-locations:seed

and the full data will be migrated to your database

Use Custom JSON Files

if you like to use your json data files it's easy you can just change the path of json on your config file with the matched json schema

    'driver' => 'json',
    
    'json' => [
        'countries' => base_path('resources/json/countries.json'),
        'cities' => base_path('resources/json/cities.json'),
        'areas' => base_path('resources/json/areas.json'),
        'languages' => base_path('resources/json/languages.json'),
        'currencies' => base_path('resources/json/currencies.json'),
    ],

Currency Helper

we have ready to use helper to convert the money amount to the currency symbol

dollar($amount) // Output $100.00

Publish Assets

you can publish config file by use this command

php artisan vendor:publish --tag="filament-locations-config"

you can publish views file by use this command

php artisan vendor:publish --tag="filament-locations-views"

you can publish languages file by use this command

php artisan vendor:publish --tag="filament-locations-lang"

you can publish migrations file by use this command

php artisan vendor:publish --tag="filament-locations-migrations"

Other Filament Packages

Checkout our Awesome TomatoPHP

统计信息

  • 总下载量: 18.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 2
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-08