dejwcake/craftable-translatable
最新稳定版本:2.0.0
Composer 安装命令:
composer require dejwcake/craftable-translatable
包简介
Make your Eloquent models and other content translated into multiple languages
关键字:
README 文档
README
Translatable makes your content easily translatable into the locales (languages) you define. In short, the package:
- publishes a config file that defines the locales (languages) used in your project,
- provides a
HasTranslationstrait that makes your Eloquent model translatable (extendingspatie/laravel-translatable), - provides a
WithTranslationsinterface that marks your Eloquent model as translatable (the trait will also work without this interface), - provides a
TranslatableFormRequestclass you can use as a base for your form request classes, simplifying the definition of validation rules for translatable data.
Documentation
You can find full documentation at https://docs.getcraftable.com/#/translatable
How to develop this project
Composer
Update dependencies:
docker compose run -it --rm test composer update
Composer normalization:
docker compose run -it --rm php-qa composer normalize
Run tests
Run tests with pcov:
docker compose run -it --rm test ./vendor/bin/phpunit -d pcov.enabled=1
To regenerate snapshots use:
docker compose run -it --rm test ./vendor/bin/phpunit -d pcov.enabled=1 -d --update-snapshots
To switch between postgresql and mariadb change in docker-compose.yml DB_CONNECTION environmental variable:
- DB_CONNECTION: pgsql
+ DB_CONNECTION: mysql
Run code analysis tools (php-qa)
PHP compatibility:
docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache
Code style:
docker compose run -it --rm php-qa phpcs -s --colors --extensions=php
Fix style issues:
docker compose run -it --rm php-qa phpcbf -s --colors --extensions=php
Static analysis (phpstan):
docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon
Mess detector (phpmd):
docker compose run -it --rm php-qa phpmd ./config,./src,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml
统计信息
- 总下载量: 971
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-06