@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $this->info('Migration successfully created!'); |
| 54 | 54 | } else { |
| 55 | 55 | $this->error( |
| 56 | - 'Couldn\'t create migration.'.PHP_EOL.' Check the write permissions |
|
| 56 | + 'Couldn\'t create migration.' . PHP_EOL . ' Check the write permissions |
|
| 57 | 57 | within the database/migrations directory.' |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -24,10 +24,10 @@ |
||
| 24 | 24 | $options['scope'] = $request->scope; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - $texts = Text::where(function ($q) use ($options) { |
|
| 27 | + $texts = Text::where(function($q) use ($options) { |
|
| 28 | 28 | foreach ($options as $k => $v) { |
| 29 | 29 | if ($k == 'keyword') { |
| 30 | - $q->where(function ($query) use ($v) { |
|
| 30 | + $q->where(function($query) use ($v) { |
|
| 31 | 31 | $query->where('key', 'LIKE', '%' . $v . '%')->orWhere('value', 'LIKE', '%' . $v . '%'); |
| 32 | 32 | }); |
| 33 | 33 | } else { |
@@ -28,16 +28,15 @@ |
||
| 28 | 28 | /** |
| 29 | 29 | * Create a new MultiLang instance. |
| 30 | 30 | * |
| 31 | - * @param string $environment |
|
| 32 | - * @param array $config |
|
| 33 | - * @param \Illuminate\Cache\CacheManager $cache |
|
| 34 | - * @param \Illuminate\Database\DatabaseManager $db |
|
| 35 | 31 | */ |
| 36 | 32 | public function __construct(array $data) |
| 37 | 33 | { |
| 38 | 34 | $this->data = $data; |
| 39 | 35 | } |
| 40 | 36 | |
| 37 | + /** |
|
| 38 | + * @param string $key |
|
| 39 | + */ |
|
| 41 | 40 | public function get($key = null, $default = null) |
| 42 | 41 | { |
| 43 | 42 | $array = $this->data; |
@@ -12,9 +12,6 @@ |
||
| 12 | 12 | |
| 13 | 13 | use Illuminate\Cache\CacheManager as Cache; |
| 14 | 14 | use Illuminate\Database\DatabaseManager as Database; |
| 15 | -use Illuminate\Http\Request; |
|
| 16 | -use Illuminate\Support\Collection; |
|
| 17 | -use InvalidArgumentException; |
|
| 18 | 15 | use Longman\LaravelMultiLang\Config; |
| 19 | 16 | |
| 20 | 17 | class Repository |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use Illuminate\Cache\CacheManager as Cache; |
| 15 | 15 | use Illuminate\Database\DatabaseManager as Database; |
| 16 | 16 | use Illuminate\Http\Request; |
| 17 | -use Illuminate\Routing\Router; |
|
| 18 | 17 | use InvalidArgumentException; |
| 19 | 18 | use Longman\LaravelMultiLang\Config; |
| 20 | 19 | use Longman\LaravelMultiLang\Repository; |
@@ -288,9 +288,9 @@ |
||
| 288 | 288 | |
| 289 | 289 | foreach ($locales as $locale => $val) { |
| 290 | 290 | $router->group([ |
| 291 | - 'prefix' => $locale, |
|
| 292 | - 'as' => $locale . '.', |
|
| 293 | - ], $callback); |
|
| 291 | + 'prefix' => $locale, |
|
| 292 | + 'as' => $locale . '.', |
|
| 293 | + ], $callback); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function getQualifiedLocalizableColumn() |
| 32 | 32 | { |
| 33 | - return $this->getTable().'.'.$this->getLocalizableColumn(); |
|
| 33 | + return $this->getTable() . '.' . $this->getLocalizableColumn(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
@@ -203,11 +203,11 @@ |
||
| 203 | 203 | $this->getDb() |
| 204 | 204 | ->table($table) |
| 205 | 205 | ->insert([ |
| 206 | - 'key' => $k, |
|
| 207 | - 'lang' => $lang, |
|
| 208 | - 'scope' => $scope, |
|
| 209 | - 'value' => $v, |
|
| 210 | - ]); |
|
| 206 | + 'key' => $k, |
|
| 207 | + 'lang' => $lang, |
|
| 208 | + 'scope' => $scope, |
|
| 209 | + 'value' => $v, |
|
| 210 | + ]); |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | return true; |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | ->where('lang', $lang); |
| 83 | 83 | |
| 84 | 84 | if (!is_null($scope)) { |
| 85 | - $query = $query->whereNested(function ($query) use ($scope) { |
|
| 85 | + $query = $query->whereNested(function($query) use ($scope) { |
|
| 86 | 86 | $query->where('scope', 'global'); |
| 87 | 87 | $query->orWhere('scope', $scope); |
| 88 | 88 | }); |
@@ -41,8 +41,7 @@ |
||
| 41 | 41 | /** |
| 42 | 42 | * Create a new MultiLang instance. |
| 43 | 43 | * |
| 44 | - * @param string $environment |
|
| 45 | - * @param array $config |
|
| 44 | + * @param Config $config |
|
| 46 | 45 | * @param \Illuminate\Cache\CacheManager $cache |
| 47 | 46 | * @param \Illuminate\Database\DatabaseManager $db |
| 48 | 47 | */ |
@@ -35,9 +35,9 @@ |
||
| 35 | 35 | { |
| 36 | 36 | // Publish config files |
| 37 | 37 | $this->publishes([ |
| 38 | - __DIR__ . '/../config/config.php' => config_path('multilang.php'), |
|
| 39 | - __DIR__ . '/../views' => base_path('resources/views/vendor/multilang'), |
|
| 40 | - ]); |
|
| 38 | + __DIR__ . '/../config/config.php' => config_path('multilang.php'), |
|
| 39 | + __DIR__ . '/../views' => base_path('resources/views/vendor/multilang'), |
|
| 40 | + ]); |
|
| 41 | 41 | |
| 42 | 42 | // Append the country settings |
| 43 | 43 | $this->mergeConfigFrom( |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | 48 | // Register blade directives |
| 49 | - Blade::directive('t', function ($expression) { |
|
| 49 | + Blade::directive('t', function($expression) { |
|
| 50 | 50 | return "<?php echo e(t({$expression})); ?>"; |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | - $this->app['events']->listen(RouteMatched::class, function () { |
|
| 53 | + $this->app['events']->listen(RouteMatched::class, function() { |
|
| 54 | 54 | $scope = $this->app['config']->get('app.scope'); |
| 55 | 55 | if ($scope && $scope != 'global') { |
| 56 | 56 | $this->app['multilang']->setScope($scope); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $configPath = __DIR__ . '/../config/config.php'; |
| 72 | 72 | $this->mergeConfigFrom($configPath, 'debugbar'); |
| 73 | 73 | |
| 74 | - $this->app->singleton('multilang', function ($app) { |
|
| 74 | + $this->app->singleton('multilang', function($app) { |
|
| 75 | 75 | $environment = $app->environment(); |
| 76 | 76 | $config = $app['config']->get('multilang'); |
| 77 | 77 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | if ($multilang->autoSaveIsAllowed()) { |
| 86 | - $app->terminating(function () use ($multilang) { |
|
| 86 | + $app->terminating(function() use ($multilang) { |
|
| 87 | 87 | $scope = $this->app['config']->get('app.scope'); |
| 88 | 88 | if ($scope && $scope != 'global') { |
| 89 | 89 | $multilang->setScope($scope); |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | $this->app->alias('multilang', 'Longman\LaravelMultiLang\MultiLang'); |
| 99 | 99 | |
| 100 | 100 | $this->app['command.multilang.migration'] = $this->app->share( |
| 101 | - function () { |
|
| 101 | + function() { |
|
| 102 | 102 | return new MigrationCommand(); |
| 103 | 103 | } |
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | 106 | $this->app['command.multilang.texts'] = $this->app->share( |
| 107 | - function () { |
|
| 107 | + function() { |
|
| 108 | 108 | return new TextsCommand(); |
| 109 | 109 | } |
| 110 | 110 | ); |