Skip to content

Commit

Permalink
Providers, Extras
Browse files Browse the repository at this point in the history
  • Loading branch information
fulviocanducci committed Sep 11, 2020
1 parent e19dd5e commit 983a96e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,17 @@
"php artisan vendor:publish --provider=Vendor\\Canducci\\ZipCode\\Providers\\ZipCodeServiceProvider",
"php artisan vendor:publish --provider=Vendor\\Canducci\\ZipCode\\Providers\\ZipCodeAddressServiceProvider"
]
},
"extra": {
"laravel": {
"providers": [
"Canducci\\ZipCode\\Providers\\ZipCodeServiceProvider",
"Canducci\\ZipCode\\Providers\\ZipCodeAddressServiceProvider"
],
"aliases": {
"ZipCode": "Canducci\\ZipCode\\Facades\\ZipCode",
"Address": "Canducci\\ZipCode\\Facades\\ZipCodeAddress"
}
}
}
}
12 changes: 7 additions & 5 deletions src/Canducci/ZipCode/Providers/ZipCodeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ class ZipCodeServiceProvider extends ServiceProvider
public function boot()
{
$this->publishes([
__DIR__ . '../config/simplecache.php' => config_path('simplecache.php'),
]);
__DIR__ . '/../config/simplecache.php' => config_path('simplecache.php'),
], 'simplecache');
}
public function register()
{
if (isset($this->app[PhpExtended\SimpleCache\SimpleCacheFilesystem::class]) === false) {
if (isset($this->app['PhpExtended\SimpleCache\SimpleCacheFilesystem']) === false) {
$this->app->singleton(
\PhpExtended\SimpleCache\SimpleCacheFilesystem::class,
new \PhpExtended\SimpleCache\SimpleCacheFilesystem(config('simplecache.path') ?? __DIR__)
'PhpExtended\SimpleCache\SimpleCacheFilesystem',
function ($app) {
return new \PhpExtended\SimpleCache\SimpleCacheFilesystem(config('simplecache.path') ?? __DIR__);
}
);
}
if (isset($this->app[\Canducci\ZipCode\Contracts\ZipCodeRequestContract::class]) === false) {
Expand Down
7 changes: 4 additions & 3 deletions src/Canducci/ZipCode/config/simplecache.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
return [
'path' => storage_path('framework/cache')
];
<?php
return [
'path' => storage_path('framework/cache')
];

0 comments on commit 983a96e

Please sign in to comment.