-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the tinker command #116
Conversation
Pull Request Test Coverage Report for Build 581
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, very useful to use in the console. @josephmancuso What do you think?
No way. @mapeveri suggested this a while ago but I couldn't figure out how to do this lol. I'm gonna review now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be added to the container. It currently won't be accessible when running craft
. All commands are registered in the AppProvider register method
Whoops. Fixed. It's in the container now. |
wow this is awesome. |
are there other things we should load in? |
I'm not sure. I was thinking that it might be helpful to automatically load in the models, but I figured many people would be putting those into the container anyway, so no real need. If we had more facades, then maybe those as well, but since there's only one, I'm not sure if it is particularly useful. |
very true. Yeah if people need things loaded in they should just make a service provider to do it. |
Added this out of inspiration. I've based this off of develop so that we may have more discussion and push it out with the 2.0 release.
In essence, the
craft tinker
command is nothing more special than a python console with the container pre-loaded as a variableapp
. What is nice about it is that it allows us to more easily tinker around with the internals of the application either for testing or for seeding information before creating the store routes in our app. For instance you could do the following to retrieve all users.For beginners, this will be a valuable tool for them to be able to play around with the container in an interactive way.
If there's anything else you want me to import by default into this console, that can easily be done.