mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-08 22:14:48 +00:00
Laravel 13 upgrade, updates and fixes
This commit is contained in:
45
app/Hashids/HashidsServiceProvider.php
Normal file
45
app/Hashids/HashidsServiceProvider.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Hashids;
|
||||
|
||||
use Hashids\Hashids as HashidsClient;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class HashidsServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->singleton('hashids.factory', function () {
|
||||
return new HashidsFactory;
|
||||
});
|
||||
|
||||
$this->app->alias('hashids.factory', HashidsFactory::class);
|
||||
|
||||
$this->app->singleton('hashids', function (Container $app) {
|
||||
return new HashidsManager($app['config'], $app['hashids.factory']);
|
||||
});
|
||||
|
||||
$this->app->alias('hashids', HashidsManager::class);
|
||||
|
||||
$this->app->bind('hashids.connection', function (Container $app) {
|
||||
return $app['hashids']->connection();
|
||||
});
|
||||
|
||||
$this->app->alias('hashids.connection', HashidsClient::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [
|
||||
'hashids',
|
||||
'hashids.factory',
|
||||
'hashids.connection',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user