Skip to content

Commit

Permalink
Laravel 6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Torann committed Nov 26, 2019
1 parent 591f2db commit dc19a82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
7 changes: 1 addition & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"authors": [
{
"name": "Daniel Stainback",
"email": "daniel@lyften.com"
"email": "torann@gmail.com"
}
],
"require": {
Expand All @@ -18,10 +18,5 @@
"psr-4": {
"Torann\\Hashids\\": "src/Torann/Hashids"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
}
}
14 changes: 9 additions & 5 deletions src/Torann/Hashids/HashidsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php namespace Torann\Hashids;

use Hashids\Hashids;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;

Expand Down Expand Up @@ -34,9 +36,9 @@ public function register()
$config = $app->config->get('hashids');

return new Hashids(
array_get($config, 'salt'),
array_get($config, 'length', 0),
array_get($config, 'alphabet')
Arr::get($config, 'salt'),
Arr::get($config, 'length', 0),
Arr::get($config, 'alphabet')
);
});
}
Expand All @@ -48,7 +50,7 @@ public function register()
*/
protected function isLumen()
{
return str_contains($this->app->version(), 'Lumen') === true;
return Str::contains($this->app->version(), 'Lumen') === true;
}

/**
Expand All @@ -58,6 +60,8 @@ protected function isLumen()
*/
public function provides()
{
return ['hashids'];
return [
'hashids',
];
}
}

0 comments on commit dc19a82

Please sign in to comment.