Comments (12)
Brilliant!!
from tinx.
Just pushed to master so you can do:
php artisan tinx myfile.php alsothisfile.php
Just like in tinker. (scrap syntax in my above comment ).
I understand now this was not really what you asked for. I am not sure how that would work with the service providers? Guess thats mostly becaouse I am new to the concept of service providers. It sounds great though it would be nice with an example.
What do you say about this @furey ?
from tinx.
Hi @ajthinking,
I agree that piping the "include" array through to Tinker (as you've just pushed to master
) works perfectly, allowing users to easily inject whatever extra functionality they require on a per command basis… just as they can already with Tinker itself!
To enhance this idea, I've just pushed to master
the ability to set Tinker includes via config.
So now, a user can either pass their list of includes on a per command basis…
php artisan tinx include-1.php include-2.php
…or define them in their config file to be included every time they run tinx
…
<?php
// 'config/tinx.php'
return [
// etc…
'include' => [
'include-1.php',
'include-2.php',
],
];
Sweet?
from tinx.
@ajthinking Ready for a v0.8
?
from tinx.
@furey just relased v0.8! As collaborator, are you allowed to release, merge etc? If so, feel free to push releases you see fit! Its always very inspiring to see your code.
from tinx.
Thanks @imam :)
Actually you can do
Php artisan tinker --include myfile.php
This is whats utialized to enaeble tinx.
However, these includes are currently not passed through to the underlying tinker session. Finally I like the idea of easely putting more functions one might need in a easy way. What about using your own global helpers?
from tinx.
Sweet! But I'm still thinking that there should be a way to add a custom shortcut by adding some functions to a service provider would be awesome because people can actually add add-ons for this package, maybe like creating a search package to tinx
or anything, adding something like Tinx::addFunction('search', function($params..)
to their custom service provider, and boom, extendable Tinx that people can use just by requiring a package.
from tinx.
I'll try to do a pull request later just to show you what I meant :). If you think it's cool, we should reopen this issue so people can give it some thoughts and ideas for this concept
from tinx.
Wow @imam that idea is beyond beafutiful! Think I understand now. Its definitly a reopened issue :)
from tinx.
Hi @imam,
Have you had any further thoughts on this?
As mentioned previously in https://github.com/ajthinking/tinx/issues/23#issuecomment-339677755, I'm confident that passing your own include file(s) satisfies most use cases, but I'm happy to hear more if you have further to share!
If you're no longer thinking about it, please close the issue.
Cheers!
from tinx.
Hi @furey
I do have some thoughts on this, but for the last 2-3 weeks, I've decided to take some breaks from work that's why I became silent :). Nevertheless, I want to work on a pull request for this feature, and I want to share it when it is 100% finished, it might take some time but I think it would be worth it :).
from tinx.
Hi @imam,
Taking breaks from work every now and again is super important – good on you.
I'm closing this issue in anticipation of your eventual PR.
If you never get around to it, that's okay – no pressure. But if and when you do… sweet!
Take it easy!
from tinx.
Related Issues (20)
- Contact details HOT 1
- re() doesn't reload observers code HOT 5
- Tinx does not remember command history HOT 4
- Reload does not reload files HOT 4
- Cursor Navigation in prompt HOT 1
- Shortcut gets 'undefined variable in Psy Shell' HOT 2
- PDO::prepare(): send of 40 bytes failed with errno=32 Broken pipe HOT 1
- re() doesn't reload changes in models located at app folder HOT 3
- Permission Denied HOT 9
- Lumen 5.3 "Class Illuminate\Foundation\Bootstrap\LoadConfiguration does not exist" HOT 1
- Running php artisan tinx prints the banner and exits. HOT 1
- re() doesn't reload route changes HOT 1
- Is it safe to use Tinx in production environments? HOT 2
- Flare config is not loaded HOT 5
- Conflict with Facade/Ignition HOT 1
- Method get does not exist HOT 2
- Class 'Arr' not found on start up HOT 2
- Faker not being loaded. HOT 1
- Support use of Thinker V2.0.0 HOT 1
- Call to undefined function Ajthinking/Tinx/Console/str_plural() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinx.