Skip to content

Commit 436d743

Browse files
laravel-shiftactions-user
authored andcommitted
Prettified Code!
1 parent b52212c commit 436d743

File tree

10 files changed

+25
-32
lines changed

10 files changed

+25
-32
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ If you discover any security related issues, please check [SECURITY](https://git
8888

8989
## Credits
9090

91-
- [Tom Witkowski](https://github.com/Gummibeer) *current maintainer*
92-
- [Dimitrios Savvopoulos](https://github.com/dimsav) *original author*
93-
- [David Llop](https://github.com/Lloople) *refactoring testsuite*
94-
- [Caneco](https://github.com/caneco) *artwork*
91+
- [Tom Witkowski](https://github.com/Gummibeer) _current maintainer_
92+
- [Dimitrios Savvopoulos](https://github.com/dimsav) _original author_
93+
- [David Llop](https://github.com/Lloople) _refactoring testsuite_
94+
- [Caneco](https://github.com/caneco) _artwork_
9595
- [All Contributors](../../contributors)
9696

9797
## Versions
9898

9999
| Package | Laravel | PHP |
100-
|:--------------------|:------------------------------|:----------|
100+
| :------------------ | :---------------------------- | :-------- |
101101
| **v11.10 - v11.10** | `8.* / 9.*` | `^8.0` |
102102
| **v11.6 - v11.9** | `5.8.* / 6.* / 7.* / 8.*` | `>=7.2` |
103103
| **v11.4 - v11.5** | `5.6.* / 5.7.* / 5.8.* / 6.*` | `>=7.1.3` |

docs/package/fallback-locale.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you do not want to define the default fallback locale but just get the first
2525
'de' => [
2626
'DE',
2727
'AT',
28-
'CH',
28+
'CH',
2929
],
3030
]
3131
// ...
@@ -93,15 +93,15 @@ protected function isEmptyTranslatableAttribute(string $key, $value): bool
9393

9494
Since version v5.3 it is possible to use country based locales. For example, you can have the following locales:
9595

96-
* English: `en`
97-
* Spanish: `es`
98-
* Mexican Spanish: `es-MX`
99-
* Colombian Spanish: `es-CO`
96+
- English: `en`
97+
- Spanish: `es`
98+
- Mexican Spanish: `es-MX`
99+
- Colombian Spanish: `es-CO`
100100

101101
To configuration for these locales looks like this:
102102

103103
```php
104-
'locales' => [
104+
'locales' => [
105105
'en',
106106
'es' => [
107107
'MX',
@@ -119,4 +119,3 @@ We can also configure the "glue" between the language and country. If for instan
119119
What applies for the fallback of the locales using the `en-MX` format?
120120

121121
Let's say our fallback locale is `en`. Now, when we try to fetch from the database the translation for the locale `es-MX`but it doesn't exist, we won't get as fallback the translation for `en`. Translatable will use as a fallback `es` \(the first part of `es-MX`\) and only if nothing is found, the translation for `en` is returned.
122-

docs/package/interface.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ interface TranslatableProtected
1111
{
1212
// detect if a given translation attribute value is empty or not
1313
protected function isEmptyTranslatableAttribute(string $key, $value): bool;
14-
14+
1515
// save all attached translations
1616
protected function saveTranslations(): bool;
1717
}
1818
```
19-
20-
21-

docs/package/locales-helper.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,3 @@ Checks if the given locale is a country specific locale.
7878
### getLanguageFromCountryBasedLocale\(string $locale\)
7979

8080
Returns the language locale from given country based locale.
81-

docs/package/methods.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Preconditions
44

5-
* the `locale` is set to `de`
6-
* the `fallback_locale` is set to `en`
7-
* our main model instance is `$post = Post::first()`
8-
* translations are available for `en`, `de` and `fr`
5+
- the `locale` is set to `de`
6+
- the `fallback_locale` is set to `en`
7+
- our main model instance is `$post = Post::first()`
8+
- translations are available for `en`, `de` and `fr`
99

1010
## Get an instance of the translation model
1111

@@ -124,4 +124,3 @@ disables autoload and returns parent attributes
124124
### static defaultAutoloadTranslations\(\)
125125

126126
does not change the default behavior logic
127-

docs/package/scopes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,3 @@ Sorts the model by a given translation column value
8686
```php
8787
Post::orderByTranslation('title')->get()
8888
```
89-

docs/package/validation-rule-factory.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,24 @@ This will return an array which adjusted the placeholder in key and string value
3232
To adjust the default `format` , `prefix` or `suffix` used by the factory you can change them in the package configuration file.
3333

3434
{% code title="config/translatable.php" %}
35+
3536
```php
3637
'rule_factory' => [
3738
'format' => \Astrotomic\Translatable\Validation\RuleFactory::FORMAT_ARRAY,
3839
'prefix' => '%',
3940
'suffix' => '%',
4041
]
4142
```
43+
4244
{% endcode %}
4345

4446
As `format` we support the two possible variants the `fill()` method supports.
4547

46-
#### RuleFactory::FORMAT\_ARRAY
48+
#### RuleFactory::FORMAT_ARRAY
4749

4850
This will create the dot-notation to support locale sub-arrays. `en.content`.
4951

50-
#### RuleFactory::FORMAT\_KEY
52+
#### RuleFactory::FORMAT_KEY
5153

5254
This will create the colon separated style. `content:en`
5355

@@ -71,4 +73,3 @@ This will use the colon style, use `{` and `}` as delimiter and use only `de` an
7173
{% hint style="info" %}
7274
You can only use defined locales. Every locale that's not in `Locales::all()`will throw an `InvalidArgumentException`.
7375
{% endhint %}
74-

docs/usage/attributes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ echo $post->{'title:de'}; // Mein erster Beitrag
1212
$post->title = 'My first edited post';
1313
echo $post->title; // My first edited post
1414
```
15-

docs/usage/forms.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ $post->title = 'My first post'; // Will update the English translatable model
5555
```php
5656
$post->fill(['title' => 'My first post']); // Will update the English translatable model
5757
```
58-

docs/usage/pivot-model.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The package trait could also be used on [pivot models](https://laravel.com/docs/
55
Because the trait introduces a new relation your base model needs a primary key - we will use an auto-increment `id` column. If you want to use an UUID string column or another key you have to set/adjust more things \(tell the model and trait which is your primary key, adjust migration ...\) but even this is possible.
66

77
{% code title="RoleUser.php" %}
8+
89
```php
910
use Illuminate\Database\Eloquent\Relations\Pivot;
1011
use Astrotomic\Translatable\Contracts\Translatable as TranslatableContract;
@@ -17,21 +18,21 @@ class RoleUser extends Pivot implements TranslatableContract
1718
public $incrementing = true;
1819
}
1920
```
21+
2022
{% endcode %}
2123

2224
{% code title="create\_role\_user\_table.php" %}
25+
2326
```php
2427
Schema::create('role_user', function(Blueprint $table) {
2528
$table->increments('id');
2629
$table->integer('user_id')->unsigned();
2730
$table->integer('role_id')->unsigned();
28-
31+
2932
$table->unique(['user_id', 'role_id']);
3033
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
3134
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
3235
});
3336
```
34-
{% endcode %}
35-
36-
3737

38+
{% endcode %}

0 commit comments

Comments
 (0)