1. Go to this page and download the library: Download hexmakina/le-marchand 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/ */
// Resolve a setting
$solver->probeSettings('settings.app.name'); // Returns 'KORAL'
// Resolve a class
$solver->probeClasses(App\Controllers\UserController::class);
// Resolve an interface
$solver->probeInterface(App\Contracts\LoggerInterface::class);
// Resolve dynamically using namespaces
$solver->probeCascade('Controllers\UserController');
$factory = new Factory($box);
// Retrieve a cached instance or create a new one
$instance = $factory->serve(App\Services\EmailService::class);
// Build a new instance of a class
$newInstance = $factory->build(App\Models\User::class);
// Create a singleton
$singleton = $factory->buildSingleton(new \ReflectionClass(App\Services\Singleton::class), ['getInstance', []]);
// Resolve a service with constructor dependencies
$controller = $box->get(App\Controllers\UserController::class);
$singleton = $factory->buildSingleton(
new \ReflectionClass(App\Services\Logger::class),
['getInstance', []]
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.