@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function login(Request $request) |
| 22 | 22 | { |
| 23 | - session(['laralang.password' => Crypt::encrypt($request->input('password'))]); |
|
| 23 | + session([ 'laralang.password' => Crypt::encrypt($request->input('password')) ]); |
|
| 24 | 24 | if (Crypt::decrypt(session('laralang.password')) != config('laralang.default.password')) { |
| 25 | 25 | return redirect(Route('laralang::login')) |
| 26 | 26 | ->with('status', 'Invalid password'); |
@@ -1,18 +1,18 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -Route::group(['middleware' => 'web', 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers'], function () { |
|
| 3 | +Route::group([ 'middleware' => 'web', 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers' ], function() { |
|
| 4 | 4 | Route::get('/login', 'LaralangController@showLogin')->name('login'); |
| 5 | 5 | Route::post('/login', 'LaralangController@login'); |
| 6 | 6 | |
| 7 | - Route::group(['middleware' => 'laralang.middleware'], function () { |
|
| 8 | - Route::get('/', function () { |
|
| 7 | + Route::group([ 'middleware' => 'laralang.middleware' ], function() { |
|
| 8 | + Route::get('/', function() { |
|
| 9 | 9 | return redirect(Route('laralang::translations')); |
| 10 | 10 | })->name('home'); |
| 11 | 11 | Route::get('/translations', 'LaralangController@showTranslations')->name('translations'); |
| 12 | 12 | Route::get('/delete/{id}', 'LaralangController@deleteTrans')->name('delete'); |
| 13 | 13 | Route::get('/edit/{id}/{translation}', 'LaralangController@editTrans'); |
| 14 | 14 | Route::get('/logout', 'LaralangController@logout')->name('logout'); |
| 15 | - Route::group(['middleware' => ['throttle:5000,1', 'bindings']], function () { |
|
| 15 | + Route::group([ 'middleware' => [ 'throttle:5000,1', 'bindings' ] ], function() { |
|
| 16 | 16 | Route::get('/api', 'LaralangController@api')->name('api'); |
| 17 | 17 | }); |
| 18 | 18 | }); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('laralang_translations', function (Blueprint $table) { |
|
| 16 | + Schema::create('laralang_translations', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('translator'); |
| 19 | 19 | $table->string('string'); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | if ($this->debug === true) { |
| 121 | 121 | $this->translation = "<font style='color:#00CC00;'>Translation loaded from DB</font>"; |
| 122 | 122 | } else { |
| 123 | - $this->translation = $existing[0]->translation; |
|
| 123 | + $this->translation = $existing[ 0 ]->translation; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return true; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | private function checkSave() |
| 133 | 133 | { |
| 134 | - if ($this->save === true){ |
|
| 134 | + if ($this->save === true) { |
|
| 135 | 135 | $trans = new DB_Translation(); |
| 136 | 136 | $trans->string = $this->string; |
| 137 | 137 | $trans->from_lang = $this->from; |
@@ -186,11 +186,11 @@ discard block |
||
| 186 | 186 | return; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $available_transoltors = ['apertium', 'mymemory']; |
|
| 189 | + $available_transoltors = [ 'apertium', 'mymemory' ]; |
|
| 190 | 190 | |
| 191 | 191 | // Checks available translators. |
| 192 | 192 | |
| 193 | - if (! in_array($this->translator, $available_transoltors)) { |
|
| 193 | + if (!in_array($this->translator, $available_transoltors)) { |
|
| 194 | 194 | if ($this->debug === true) { |
| 195 | 195 | $this->translation = "<font style='color:red;'>Not suported translator: ".$this->translator.'</font>'; |
| 196 | 196 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $words = explode(' ', $transObtained); |
| 293 | 293 | foreach ($words as $word) { |
| 294 | 294 | if ($word != '') { |
| 295 | - if ($word[0] == '*') { |
|
| 295 | + if ($word[ 0 ] == '*') { |
|
| 296 | 296 | $errors = $errors.substr($word, 1).', '; |
| 297 | 297 | } |
| 298 | 298 | } |