asheliahut / mock-laravel-app
A mock laravel app to inject into laravel components outside of laravel.
Package info
github.com/asheliahut/mock-laravel-app
Type:module
pkg:composer/asheliahut/mock-laravel-app
1.0.0
2017-10-12 00:00 UTC
Requires
- php: >=7.1
- illuminate/contracts: ^6.2
This package is not auto-updated.
Last update: 2026-03-19 21:02:27 UTC
README
Have you ever wanted to use updated 5.6+ laravel components in your Slim or other php framework applications? Now you can just inject this mock container in and you will be able to do everything you want.
$container['queue'] = static function (ContainerInterface $c): Queue {
$queue = new Queue();
// Library is broken - cast some magic to get redis to work
if ('redis' === $c['settings']['queue']['driver']) {
$connector = static function () use ($c) {
$app = new \Asheliahut\MockLaravelApp();
$redisManager = new Redis($app,'predis', [
'cluster' => false,
'default' => $c['settings']['queue'],
]);
return new RedisConnector($redisManager);
};
$queue->getQueueManager()->addConnector('redis', $connector);
}
$queue->addConnection($c['settings']['queue']);
$queue->setAsGlobal();
return $queue;
};