Giter Club home page Giter Club logo

Comments (12)

ajthinking avatar ajthinking commented on July 28, 2024 2

Brilliant!!

from tinx.

ajthinking avatar ajthinking commented on July 28, 2024 1

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.

furey avatar furey commented on July 28, 2024 1

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.

furey avatar furey commented on July 28, 2024 1

@ajthinking Ready for a v0.8?

from tinx.

ajthinking avatar ajthinking commented on July 28, 2024 1

@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.

ajthinking avatar ajthinking commented on July 28, 2024

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.

imam avatar imam commented on July 28, 2024

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.

imam avatar imam commented on July 28, 2024

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.

ajthinking avatar ajthinking commented on July 28, 2024

Wow @imam that idea is beyond beafutiful! Think I understand now. Its definitly a reopened issue :)

from tinx.

furey avatar furey commented on July 28, 2024

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.

imam avatar imam commented on July 28, 2024

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.

furey avatar furey commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.