如何用额外的参数解决laravel容器中的类?

How to resolve a class in laravel container with extra arguments?

This works perfect and without any registration:

class myClass
{
    public function __construct(Interf1 $i1, Interf2 $i2)
    {
        //some stuff
    }
}
$mc = app()->make('myClass');

What happends if you need something like this:

class myClass
{
    public function __construct(Interf1 $i1, Interf2 $i2, $x, $y)
    {
        //some stuff
    }
}

Is there an option like:

$mc = app()->make('myClass',[10,20]);

or

$mc = app()->make('myClass')->with(10,20);

I know I can use setters but thats not the point..

yes it is exactly the first version you already wrote, but you missed the keys which must match the arguments in the constructor:

$mc = app()->make('myClass',['x' => 10, 'y' => 20]);