PHP code example of kekalainen / slim-illuminate-autowire
1. Go to this page and download the library: Download kekalainen/slim-illuminate-autowire library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kekalainen / slim-illuminate-autowire example snippets
use Illuminate\Container\Container;
use Illuminate\Contracts\Container\Container as ContainerContract;
use Kekalainen\SlimIlluminateAutowire\AdvancedCallableResolverProxy;
use Slim\CallableResolver;
use Slim\Factory\AppFactory;
use Slim\Interfaces\AdvancedCallableResolverInterface;
// Instantiate the Illuminate container.
$container = new Container();
// Bind the container instance into the container.
$container->instance(ContainerContract::class, $container);
// Bind a concrete advanced callable resolver to be proxied.
$container->bind(AdvancedCallableResolverInterface::class, CallableResolver::class);
// Resolve the proxied callable resolver.
$callableResolver = $container->make(AdvancedCallableResolverProxy::class);
// Set the static properties of the Slim App factory.
AppFactory::setContainer($container);
AppFactory::setCallableResolver($callableResolver);
// Instantiate the Slim App.
$app = AppFactory::create();