Skip to content

Commit a66ded2

Browse files
author
Alexander Stoimenov
committed
Changes for working with laravel 5.2
1 parent 816a52e commit a66ded2

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

composer.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@
33
"description": "Database localization package for laravel framework",
44
"keywords": ["framework", "laravel", "despark", "localization", "database"],
55
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Tihomir Banov",
9-
"email": "tbanov@despark.com"
10-
}
11-
],
6+
"authors": [{
7+
"name": "Tihomir Banov",
8+
"email": "tbanov@despark.com"
9+
}],
1210
"require": {
1311
"php": ">=5.4.0",
14-
"illuminate/auth": "5.1.*",
15-
"illuminate/support": "5.1.*",
16-
"illuminate/routing": "5.1.*",
17-
"illuminate/database": "5.1.*"
12+
"illuminate/auth": "^5.1",
13+
"illuminate/support": "^5.1",
14+
"illuminate/routing": "^5.1",
15+
"illuminate/database": "^5.1"
1816
},
1917
"autoload": {
2018
"psr-4": {
2119
"Despark\\LaravelDbLocalization\\": "src/"
2220
}
2321
},
2422
"minimum-stability": "stable"
25-
}
23+
}

src/i18nModelTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function getI18nId($locale = null)
9595
public function translate($locale = false, $alowRevision = false)
9696
{
9797
$translation = null;
98-
$translationModel = new $this->translator();
98+
$translationModel = new $this->translator();
9999

100100
if (!is_int($locale)) {
101101
$locale = $this->getI18nId($locale);
@@ -133,7 +133,7 @@ public function scopeWithTranslations($query, $locale = null, $softDelete = null
133133
$translatorField = $this->getTranslatorField();
134134
$localeField = $this->getLocaleField();
135135

136-
if (! $locale) {
136+
if (!$locale) {
137137
$query = $query->leftJoin(
138138
$translatorTableName,
139139
$translatorTableName.'.'.$translatorField, '=', $translatableTable.'.id');
@@ -170,7 +170,7 @@ public function scopeWithTranslations($query, $locale = null, $softDelete = null
170170
public function save(array $options = [])
171171
{
172172
if (empty($options)) {
173-
$options = \Input::all();
173+
$options = \Request::all();
174174
}
175175

176176
parent::save($options);
@@ -225,7 +225,7 @@ public function saveTranslations($translatableId, $options)
225225
$result = $query->first();
226226

227227
if (!isset($result->id)) {
228-
if (! isset($translation->id)) {
228+
if (!isset($translation->id)) {
229229
$translation = new $modelName();
230230
}
231231

src/migrations/2015_04_28_100423_create_i18n_table.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ public function up()
1212
{
1313
Schema::create('i18n', function (Blueprint $table) {
1414
$table->increments('id');
15+
1516
$table->string('locale')->unique()->index();
1617
$table->string('name')->index();
18+
1719
$table->timestamps();
1820
});
1921
}

src/models/I18n.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class I18n extends Eloquent
1515

1616
protected $rules = [
1717
'locale' => 'required',
18-
'name' => 'required',
18+
'name' => 'required',
1919
];
2020
}

0 commit comments

Comments
 (0)