Skip to content

Commit

Permalink
alias service provider name
Browse files Browse the repository at this point in the history
  • Loading branch information
Recca Tsai committed Nov 25, 2016
1 parent b7f1510 commit 6a8f6b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add Presenter to your composer.json file:

```js
"require": {
"recca0120/terminal": "^1.6"
"recca0120/terminal": "^1.6.3"
}
```
Now, run a composer update on the command line from the root of your project:
Expand All @@ -32,15 +32,15 @@ Include the service provider within `app/config/app.php`. The service povider is
```php
'providers' => [
...
Recca0120\Terminal\ServiceProvider::class,
Recca0120\Terminal\TerminalServiceProvider::class,
...
];
```

publish

```php
artisan vendor:publish --provider="Recca0120\Terminal\ServiceProvider"
artisan vendor:publish --provider="Recca0120\Terminal\TerminalServiceProvider"
```


Expand Down
3 changes: 2 additions & 1 deletion src/Console/Commands/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Database\DatabaseManager;
use PDO;
use Symfony\Component\Console\Input\InputOption;
use Illuminate\Support\Arr;

class Mysql extends Command
{
Expand Down Expand Up @@ -52,7 +53,7 @@ public function fire()
$connection->setFetchMode(PDO::FETCH_ASSOC);
$query = $this->option('command');
$rows = $connection->select($query);
$headers = array_keys(array_get($rows, 0, []));
$headers = array_keys(Arr::get($rows, 0, []));
$this->table($headers, $rows);
}

Expand Down
5 changes: 3 additions & 2 deletions src/TerminalServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Http\Request;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Arr;

class TerminalServiceProvider extends ServiceProvider
{
Expand All @@ -24,7 +25,7 @@ class TerminalServiceProvider extends ServiceProvider
public function boot(Request $request, Router $router)
{
$config = $this->app['config']['terminal'];
if (in_array($request->getClientIp(), array_get($config, 'whitelists', [])) === true || array_get($config, 'enabled') === true) {
if (in_array($request->getClientIp(), Arr::get($config, 'whitelists', [])) === true || Arr::get($config, 'enabled') === true) {
$this->loadViewsFrom(__DIR__.'/../resources/views', 'terminal');
$this->handleRoutes($router, $config);
}
Expand Down Expand Up @@ -63,7 +64,7 @@ protected function handleRoutes(Router $router, $config = [])
if ($this->app->routesAreCached() === false) {
$router->group(array_merge([
'namespace' => $this->namespace,
], array_get($config, 'route', [])), function (Router $router) {
], Arr::get($config, 'route', [])), function (Router $router) {
require __DIR__.'/Http/routes.php';
});
}
Expand Down

0 comments on commit 6a8f6b0

Please sign in to comment.