@@ -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'); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $words = explode(' ', $transObtained); |
| 44 | 44 | foreach ($words as $word) { |
| 45 | 45 | if ($word != '') { |
| 46 | - if ($word[0] == '*') { |
|
| 46 | + if ($word[ 0 ] == '*') { |
|
| 47 | 47 | $errors = $errors.substr($word, 1).', '; |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | if ($this->debug === true) { |
| 119 | 119 | $this->translation = "<font style='color:#00CC00;'>Translation loaded from DB</font>"; |
| 120 | 120 | } else { |
| 121 | - $this->translation = $existing[0]->translation; |
|
| 121 | + $this->translation = $existing[ 0 ]->translation; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | return true; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | public static function trans($string) |
| 12 | 12 | { |
| 13 | 13 | $translator = config('laralang.default.translator'); |
| 14 | - if (!in_array(config('laralang.default.translator'), ['apertium', 'mymemory'])) { |
|
| 14 | + if (!in_array(config('laralang.default.translator'), [ 'apertium', 'mymemory' ])) { |
|
| 15 | 15 | return new Exception("<font style='color:red;'>Laralang doesn't support $translator translator. Check config</font>"); |
| 16 | 16 | } else { |
| 17 | 17 | if (config('laralang.default.translator') == 'mymemory') { |