Code Monkey home page Code Monkey logo

Comments (18)

Jeroen-G avatar Jeroen-G commented on July 28, 2024

I see the value in this as well, although the make:validator should go in the validator package. I could contribute too.

from l5-repository.

 avatar commented on July 28, 2024

Yea sure, the command for validator should go into the validator package.

from l5-repository.

Jeroen-G avatar Jeroen-G commented on July 28, 2024

I think you should just place a PR. Although I don't know if @andersao prefers it on the master or develop branch.

from l5-repository.

hiddeco avatar hiddeco commented on July 28, 2024

+1.

@ionut-tanasa @Jeroen-G
From what I know. PR quick fixes and small additions to master, completely new functions to develop.
So master would be more suitable for this.

from l5-repository.

andersao avatar andersao commented on July 28, 2024

Hello guys @ionut-tanasa @Jeroen-G @hiddeco ,

I liked the suggestion and I think it will be great to add new commands . What about the branch , the @hiddeco is right. Rather than new features being sent to branch Develop or create other specific branch .

The contribution of you will be very well accepted ;)

from l5-repository.

hiddeco avatar hiddeco commented on July 28, 2024

@ionut-tanasa, are you gonna make a PR? Otherwise I will make one this week. 

from l5-repository.

 avatar commented on July 28, 2024

@hiddeco please do.

I just started the command for the transformer. Maybe you can do the other one/ones?

from l5-repository.

Jeroen-G avatar Jeroen-G commented on July 28, 2024

If you've created a PR-repo you can give others push access to it, so it can be one PR.

from l5-repository.

 avatar commented on July 28, 2024

Check #55.

I gave you push access to the repo.

Now it's basic stuff. Maybe we could specify with which properties the return array from the transformer will be filled. Like the --fillable argument for the Model

from l5-repository.

hiddeco avatar hiddeco commented on July 28, 2024

That is actually a great idea, you just want to copy the column names from the database to the transformer then? Because most transformers contain different names than the database columns do (at least mine do).

from l5-repository.

 avatar commented on July 28, 2024

@andersao I love that you are merging so quick my PRs

I'll make the basic presenter command and pr it. then you could improve it and more features to it

from l5-repository.

andersao avatar andersao commented on July 28, 2024

And I 'm loving the contribution of you.

from l5-repository.

 avatar commented on July 28, 2024

Just a quick question. I'm trying to understand how to pass variables to the stubs.

In the presenter, obviously, I need to use the transformer class. How do I get the root namespace and pass it to the stub in order to write the exact namespace of the transformer?

I am assuming that the Presenter will use a Transformer with the same name.

So when I run make:presenter MODEL, I assume that you already have a MODELTRansformer created.
Maybe I can check that, if the transformer does not exist I can create it for the user.

So how do I pass the root namespace, i.e. App so on top of the class I can use App\Transformers\MODELTransformer ?

from l5-repository.

hiddeco avatar hiddeco commented on July 28, 2024

Laravel has a trait for this: Illuminate\Console\AppNamespaceDetectorTrait

Then you could use $this->getAppNamespace()

from l5-repository.

 avatar commented on July 28, 2024

Maybe I didn't explain myself very well 😄

I know how to get the app namespace from Laravel. My question was: How do I pass the namespace as $APPNAMESPACE$ to the stub file?

from l5-repository.

hiddeco avatar hiddeco commented on July 28, 2024

If you take a quick look at the Generator.php you can find the getReplacement() function. This loads the replacements for the stub file. You can extend the function in your own generator.

Untested example

    /**
     * Get array replacements.
     *
     * @return array
     */
    public function getReplacements()
    {
        return array_merge(parent::getReplacements(), [
            'appnamespace' => $this->getAppNamespace()
        ]);
    }

from l5-repository.

 avatar commented on July 28, 2024

thank you @hiddeco

@andersao PR done #57

from l5-repository.

 avatar commented on July 28, 2024

Done. Closing

from l5-repository.

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.