I've built a console app using illuminate/console
, and I would like to use a Laravel package in one of the commands.
The package's instructions say:
Add the service provider to config/app.php
'Syntax\SteamApi\SteamApiServiceProvider'
How should I register the above service provider and use its facades when not using the full Laravel framework?
Here is my app.php file, which I run in the console with php app.php
:
<?php
use Illuminate\Console\Application;
use Illuminate\Container\Container;
use Illuminate\Events\Dispatcher;
use Myvendor\Myproject\Console\Commands\Mycommand;
if (file_exists($a = __DIR__.'/../../autoload.php')) {
require_once $a;
} else {
require_once __DIR__.'/vendor/autoload.php';
}
$container = new Container;
$dispatcher = new Dispatcher;
$version = "5.5"; // Laravel version
$app = new Application($container, $dispatcher, $version);
$app->add(new Mycommand);
$app->run();
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire