Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: implement strategies #129

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
657050c
WIP: implement strategies
Gummibeer Feb 27, 2020
d090eb6
Merge remote-tracking branch 'remotes/origin/master' into issue-121
Gummibeer Apr 23, 2020
8141870
fix php cs
Gummibeer Apr 23, 2020
d7b7a27
refactor strategies to a common resolveTranslationByLocale() method
Gummibeer Apr 23, 2020
86e4fec
add FirstAvailableStrategy.php
Gummibeer Apr 23, 2020
68d2614
rename strategies to resolvers
Gummibeer Apr 23, 2020
44eb445
drop all not-latest versions
Gummibeer Apr 23, 2020
1e39040
make everything working again
Gummibeer Apr 23, 2020
5fa3067
fix php cs
Gummibeer Apr 23, 2020
fae4c59
Merge remote-tracking branch 'remotes/origin/master' into v12
Gummibeer Jul 31, 2020
1b4137f
Merge remote-tracking branch 'remotes/origin/v12' into issue-121
Gummibeer Jul 31, 2020
537bd02
Prettified Code!
Gummibeer Jul 31, 2020
319f845
add missing method to interface
Gummibeer Jul 31, 2020
7db2683
use conditional query builder and lazy collection to delete all trans…
Gummibeer Jul 31, 2020
8394301
type-hint interface instead of model class
Gummibeer Jul 31, 2020
8696a4c
fix/improve/shorten/rename a lot of methods
Gummibeer Jul 31, 2020
420dd3b
delete unused meta/ci files
Gummibeer Jul 31, 2020
6317049
merge all traits into Translatable
Gummibeer Jul 31, 2020
2f88527
add scopes as method to doc-block
Gummibeer Jul 31, 2020
431527e
rename default to enforced locale
Gummibeer Jul 31, 2020
9286499
rename default to enforced locale
Gummibeer Jul 31, 2020
924f99b
fix interface method return type
Gummibeer Jul 31, 2020
0043d41
rename default to enforced locale
Gummibeer Jul 31, 2020
f3aa8b8
reorder methods in test
Gummibeer Jul 31, 2020
bc32c58
make locale optional for translated in scopes
Gummibeer Jul 31, 2020
cf77fbb
fix php cs
Gummibeer Jul 31, 2020
386f530
move resolver make into own method to allow easier override
Gummibeer Jul 31, 2020
8abbd98
use faster dirty detection
Gummibeer Jul 31, 2020
bfea8c4
remove unused CI badges
Gummibeer Jul 31, 2020
054fad7
update composer.json
Gummibeer Jul 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 0 additions & 50 deletions .codeclimate.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/stale.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,13 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 7.3, 7.2]
laravel: [7.*, 6.*, 5.8.*]
php: [7.4]
laravel: [7.*]
dependency-version: [prefer-lowest, prefer-stable]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
- laravel: 5.8.*
testbench: 3.8.*
exclude:
- php: 7.4
laravel: 5.8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

Expand Down
22 changes: 0 additions & 22 deletions .scrutinizer.yml

This file was deleted.

5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-translatable/run-tests?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Arun-tests)
[![StyleCI](https://styleci.io/repos/192333549/shield)](https://styleci.io/repos/192333549)
[![ScrutinizerCI](https://img.shields.io/scrutinizer/quality/g/Astrotomic/laravel-translatable/master.svg?label=Scrutinizer&logoColor=white&logo=scrutinizer-ci&style=flat-square)](https://scrutinizer-ci.com/g/Astrotomic/laravel-translatable/)
[![Code Climate](https://img.shields.io/codeclimate/maintainability/Astrotomic/laravel-translatable.svg?label=CodeClimate&logoColor=white&logo=code-climate&style=flat-square)](https://codeclimate.com/github/Astrotomic/laravel-translatable)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/Astrotomic/laravel-translatable?logo=codecov&logoColor=white&label=Codecov&style=flat-square)](https://codecov.io/gh/Astrotomic/laravel-translatable)

[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-translatable.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/astrotomic/laravel-translatable)
[![GitBook](https://img.shields.io/badge/GitBook-Astrotomic-7e57c2.svg?style=flat-square)](https://docs.astrotomic.info/laravel-translatable)
[![Open Collective](https://img.shields.io/opencollective/all/astrotomic?label=Open%20Collective&style=flat-square)](https://opencollective.com/astrotomic)

![Laravel Translatable](docs/.gitbook/assets/laravel-translatable.png)

Expand Down
18 changes: 10 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"description": "A Laravel package for multilingual models",
"keywords": [
"laravel",
"eloquent",
"translation",
"translations",
"language",
"localization",
"database"
],
"homepage": "https://astrotomic.info",
Expand All @@ -24,14 +27,14 @@
}
],
"require": {
"php": ">=7.2",
"illuminate/contracts": "5.8.* || ^6.0 || ^7.0",
"illuminate/database": "5.8.* || ^6.0 || ^7.0",
"illuminate/support": "5.8.* || ^6.0 || ^7.0"
"php": ">=7.4",
"illuminate/contracts": "^7.0",
"illuminate/database": "^7.0",
"illuminate/support": "^7.0"
},
"require-dev": {
"orchestra/testbench": "3.8.* || ^4.0 || ^5.0",
"phpunit/phpunit": "^8.0 || ^9.0"
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^9.0"
},
"config": {
"sort-packages": true
Expand All @@ -56,9 +59,8 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"csfix": "php-cs-fixer fix --using-cache=no",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html=build"
"test-coverage": "vendor/bin/phpunit --coverage-html=coverage"
},
"support": {
"email": "dev@astrotomic.info",
Expand Down
23 changes: 11 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,24 @@ echo $post->translate('fr')->title; // Mon premier post

## Tutorials

* [How To Add Multilingual Support to Eloquent](https://laravel-news.com/how-to-add-multilingual-support-to-eloquent)
* [How To Build An Efficient and SEO Friendly Multilingual Architecture For Your Laravel Application](https://mydnic.be/post/how-to-build-an-efficient-and-seo-friendly-multilingual-architecture-for-your-laravel-application)
* [How to Add Multi-Language Models to Laravel QuickAdminPanel](https://quickadminpanel.com/blog/how-to-add-multi-language-models-to-laravel-quickadminpanel/)
- [How To Add Multilingual Support to Eloquent](https://laravel-news.com/how-to-add-multilingual-support-to-eloquent)
- [How To Build An Efficient and SEO Friendly Multilingual Architecture For Your Laravel Application](https://mydnic.be/post/how-to-build-an-efficient-and-seo-friendly-multilingual-architecture-for-your-laravel-application)
- [How to Add Multi-Language Models to Laravel QuickAdminPanel](https://quickadminpanel.com/blog/how-to-add-multi-language-models-to-laravel-quickadminpanel/)

## Credits

* [Tom Witkowski](https://github.com/Gummibeer)
* [Dimitrios Savvopoulos](https://github.com/dimsav)
* [David Llop](https://github.com/Lloople)
* [All Contributors](https://github.com/Astrotomic/laravel-translatable/graphs/contributors)
- [Tom Witkowski](https://github.com/Gummibeer)
- [Dimitrios Savvopoulos](https://github.com/dimsav)
- [David Llop](https://github.com/Lloople)
- [All Contributors](https://github.com/Astrotomic/laravel-translatable/graphs/contributors)

## Versions

| Package | Laravel | PHP |
| :--- | :--- | :--- |
| **v11.6 - v11.8** | `5.8.* / 6.* / 7.*` | `>=7.2` |
| Package | Laravel | PHP |
| :---------------- | :---------------------------- | :-------- |
| **v11.6 - v11.8** | `5.8.* / 6.* / 7.*` | `>=7.2` |
| **v11.4 - v11.5** | `5.6.* / 5.7.* / 5.8.* / 6.*` | `>=7.1.3` |
| **v11.0 - v11.3** | `5.6.* / 5.7.* / 5.8.*` | `>=7.1.3` |
| **v11.0 - v11.3** | `5.6.* / 5.7.* / 5.8.*` | `>=7.1.3` |

## Treeware

Expand All @@ -87,4 +87,3 @@ It’s now common knowledge that one of the best tools to tackle the climate cri
You can buy trees at [https://offset.earth/treeware](https://plant.treeware.earth/Astrotomic/laravel-translatable)

Read more about Treeware at [https://treeware.earth](https://treeware.earth)

29 changes: 14 additions & 15 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# Table of contents

* [Introduction](README.md)
* [Issues](issues.md)
* [Changelog](changelog.md)
* [FAQ](faq.md)
* [Installation](installation.md)
- [Introduction](README.md)
- [Issues](issues.md)
- [Changelog](changelog.md)
- [FAQ](faq.md)
- [Installation](installation.md)

## Package

* [Interface](package/interface.md)
* [Methods](package/methods.md)
* [Scopes](package/scopes.md)
* [Fallback locale](package/fallback-locale.md)
* [Locales helper](package/locales-helper.md)
* [Validation Rule Factory](package/validation-rule-factory.md)
- [Interface](package/interface.md)
- [Methods](package/methods.md)
- [Scopes](package/scopes.md)
- [Fallback locale](package/fallback-locale.md)
- [Locales helper](package/locales-helper.md)
- [Validation Rule Factory](package/validation-rule-factory.md)

## Usage

* [Attributes](usage/attributes.md)
* [Forms](usage/forms.md)
* [Pivot Model](usage/pivot-model.md)

- [Attributes](usage/attributes.md)
- [Forms](usage/forms.md)
- [Pivot Model](usage/pivot-model.md)