dejwcake/craftable-translatable
最新稳定版本:1.0.0
Composer 安装命令:
composer create-project dejwcake/craftable-translatable
包简介
Make your Eloquent models and other content translated into multiple languages
关键字:
README 文档
README
Translatable makes your content translatable in defined languages (locales). To sum up, the package:
- publishes a config, that defines locales (languages) used in your project,
- introduces a
HasTranslationstrait that makes your Eloquent model translatable (extendingspatie/laravel-translatable), - introduces a
WithTranslationsinterface that marks your Eloquent model translatable, although it will work with trait also without this interface, - introduces a
TranslatableFormRequestclass that you can use as a base class for your Request classes to extend from, which simplify the definition of the rules for translatable data.
You can find full documentation at https://docs.getcraftable.com/#/translatable
Composer
To develop this package, you need to have composer installed. To run composer command use:
docker compose run -it --rm test composer update
For composer normalization:
docker compose run -it --rm php-qa composer normalize
Run tests
To run tests use this docker environment.
docker compose run -it --rm test vendor/bin/phpunit -d pcov.enabled=1
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
To be sure, that your code is clean, you can run code analysis tools. To do this, run:
For php compatibility:
docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache
For code style:
docker compose run -it --rm php-qa phpcs -s --colors --extensions=php
or to fix issues:
docker compose run -it --rm php-qa phpcbf -s --colors --extensions=php
For static analysis:
docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon
For mess detector:
docker compose run -it --rm php-qa phpmd ./src,./install-stubs,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml
统计信息
- 总下载量: 655
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-06