Can illuminate/console be used standalone? #54894
Unanswered
yoan-myparcel
asked this question in
Q&A
Replies: 2 comments
-
You might need to check https://laravel-zero.com |
Beta Was this translation helpful? Give feedback.
0 replies
-
Personally, I gave up trying to use any of the Laravel framework code in a standalone context since the framework itself is treated as a full-stack package and standalone component use seems to be not well supported, especially given how frequently code in the framework is hard coupled to concrete implementations versus relying on only the contracts. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Laravel community! I was about to file a bug report but I decided to first check if I am not misunderstanding something!
I am using illuminate/console to power a CLI application. Since it is CLI-only, I decided that a fully configured project structure build around
Illuminate\Foundation\Application
would be unnecessary if I can just use illuminate/console.That I did successfully with version 9.* of the package, but I recently upgraded to 12.* and I ran into issues.
Basically, what I did until now is use
Illuminate\Console\Application
with aIlluminate\Container\Container
, but since version 10 (apparently), a trait calledConfiguresPrompts
, which is included inIlluminate\Console\Command
requires aIlluminate\Contracts\Foundation\Application
instead ofIlluminate\Container\Container
. Furthermore, the trait calls arunningUnitTests()
method on the app/container (depends what you inject in the Console Application object), which fails when just usingIlluminate\Container\Container
(method is not defined there since it is part of another interface).I feel like there is a type issue alone the way, but as I said above - I am not 100% sure if illuminate/console is supposed to be used in that way. The suspected type issue comes from:
I believe the the type bug is here and here.
Example
You can find the code from this example here.
The result of running the above script is the following error:
Is this worthy of a bug report?
It is a the first time I write in this community, I do not often report nor I find bugs in packages I use. Is this something for what I should report a bug instead of this discussion?
Beta Was this translation helpful? Give feedback.
All reactions