Comments (18)
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.
Yea sure, the command for validator should go into the validator package.
from l5-repository.
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.
+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.
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.
@ionut-tanasa, are you gonna make a PR? Otherwise I will make one this week.
from l5-repository.
@hiddeco please do.
I just started the command for the transformer. Maybe you can do the other one/ones?
from l5-repository.
If you've created a PR-repo you can give others push access to it, so it can be one PR.
from l5-repository.
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.
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.
@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.
And I 'm loving the contribution of you.
from l5-repository.
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.
Laravel has a trait for this: Illuminate\Console\AppNamespaceDetectorTrait
Then you could use $this->getAppNamespace()
from l5-repository.
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
from l5-repository.
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.
thank you @hiddeco
from l5-repository.
Done. Closing
from l5-repository.
Related Issues (20)
- RequestCriteria supports for Morph relationship
- Cache doesn't work
- Target class [] does not exist
- L9 Command "make:rest-controller" is not defined HOT 3
- depricated error on request citeria
- Do you have plans to update to support mongodb?
- time search on date not working HOT 2
- how to use it with yajra datatable
- Add Laravel 10 support HOT 4
- how to use exists() or doesntExist() method HOT 1
- Screenshot (Apr 25, 2023 11:23:51 PM)
- Invalid URL separator (semicolon) HOT 1
- how to search with the searchable fields with multiple values in one field ?
- Communication channel regarding security issue @andersao HOT 1
- Query Expression with laravel 10 and whereRaw query
- Can not use function simplePaginate with Presenter
- Laravel 10 criteria no longer work? HOT 2
- Hi HOT 1
- searchJoin=and doesn,t work HOT 1
- Need Laravel 11 Support HOT 13
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 l5-repository.