RayRutjes's avatar

[LUMEN] Migration class without facades

I am actually giving the Laravel Lumen micro framework a try, and I have this question. How would you access the underlying Schema facade's instance of Blueprint if you don't want to enable Facades?

The concrete Illuminate\Database\Migrations\Migration file does only provide a getConnection method, which doesn't allow us a quick and clean access to Blueprint instances.

I also note that there is no way to inject dependencies into the Migration classes, as the up and down methods are called without any arguments and not resolved from the container, and the class constructor is not resolved from the container either.

Does anyone have a nice implementation of migration classes not actually using the facades?

0 likes
5 replies
RayRutjes's avatar

Bedankt bobby,

But I would still need to resolve the connection from the database manager, pass it in, etc, etc.

I feel like the application should be injected in the Migration class, so we can resolve instances from the container. What do you think ?

Please or to participate in this conversation.