pipe-dream / laravel-create Goto Github PK
View Code? Open in Web Editor NEWCreate Laravel projects really fast
Create Laravel projects really fast
At the moment these doesn't always get it right,
i suggest a scheme where the first word is the "owner", and the second is the "child"
Example:
cart_product
Cart HasMany Products
Product BelongsTo Cart
After I cloned my github repo into my ubuntu server, it kept giving me this error for some reason, I know it's a permission error but I cannot figure out where exactly is the file that lacks the right permissions, anyone with a solution?
copy(/var/www/html/emailplat/emailplat/public/vendor/pipe-dream/laravel/data/.gitignore): failed to open stream: Permission denied
Anders :) stort TACK för att du gjort pipe-dream - så j****vla bra!
Trying to add enum datatype for 'gender' field that requires values 'male' and 'female' which can easily be achieved by 'enum' data type but it's not mentioned in 'object model' as well as in templates. the default value will be appreciated :)
One more thing it's not working in windows 7. Here are some screenshots
Thanks for the unique package 👍
Hi!
So far loving this package. Although I have not been able to use it without some anxiety of accidentally refreshing/closing the page! All contents of my sketch will dissapear and I will have to start over (yes, i could copy it over to a backup file constantly, but that isn't very nice now is it). So here's the simple suggestion: automatically store the sketch in localstorage so that we don't have to fear refreshing the page.
Hi, this is an awesome project. After refresh brower and build a new model, I found I had lost all my previous models. It's for the reason of reverseHistory. and I can't disable it.
so would it be better to remove this feature? I didn't get the meaning of reverseHistory.
Kind regards from china
After closing the dev server or sketch window, incomplete sketch text is lost. It can be stored in browser storage in order to be able to continue where it is left off.
If you create a unique field the generated PHP is ->uniqe()
instead of ->unique()
Since this great tool aim to use the best practices in industry, it would be super awesome to have pagination along with resources collection for each API controllers rather than something like all()
I had to manually delete models and then rebuild them
steps:
1 write something in the sketch and then click help button. It replaces the content of the sketch without warning.
I am getting same issue (closed) #34
Hi, I just installed it today (23-June-2019) and I am getting issue "No files yet!" in review tab and "No files to build yet" in Build tab.
Windows 10
Laravel 5.8 (clean install)
PipeDream 0.0.46
Note:
When I run php artisan serve, and use url http://localhost:8000/pipe-dream then it works fine. But when I open without php artisan serve and use url http://localhost/myproject/public/pipe-dream then this I faced this issue.
Thanks
At the moment each "model" have tons of files:
controller
APIcontroller
resource
resourceCollection
migration
seed
factory
model
I suggest that all of these should be "collapseable" into their own group.
So a model named "Car" would have all of their files under that name. Look at just the sample app there are 28 files to look through, if we grouped them up, it would be so much easier to navigate through.
Hello, Thanks for creating this repository.
But there is a similar project which is older and got tons of features called Infyom. Did you see their work? Is this project gonna offer something that they don't?
Hi. Great package!
Can you explain how i can override templates folder to use my sample controllers?
Thank you!
When writing big projects (20+ models) pipe-dream starts to be incredibly slow - we're talking multiple seconds of waiting timer per keystroke.
A lot of times after installing a new application the same recurring packages are installed that are just "essential" for every laravel development environment.
Examples:
laravelbarryvdh/laravel-debugbar
laravel/envoy
laravel/horizon
predis/predis
guzzlehttp/guzzle
And this is just a simple list, but you get the idea, just check which packages you want installed and pipe-dream/laravel will do the rest!
Hi! Will laravel-create in any future versions support the ability to create a GraphQL type system?
I installed the pipe dream in an existing project.
But I did not use the +USER SYSTEM option just created a single model and after building the module, my user and password_reset migration removed.
Thanks for the package :)
Anders,
Thank you for creating this project. Very excited for it as I can see the power of it and the future potential. I love the smart defaults and behaviours (auto id, timestamps, joins, etc).
I'm assuming this would be more useful for new projects than additional ones. But it would be great if you can take an already existing schema and import into pipedream so you can build on top of it. I know this is not an easy task but would allow a much larger number of users the ability to use this library.
Secondly, while I agree your naming conventions make sense and your ability to intelligently guess the variable type, it would be great to add very simple syntax so that we can add our expected variable types and other behaviours:
take this schema:
Car
name > VARCHAR(100)
brand_id
Driver
fullName > VC(50) - required,min:5 // you can provide/allow for abbreviated column types
yearsOfExperience > Unsigned tinyINT *
numberOfCollisions > Unsigned tinyInt *
email - email,required
address !
driver_car
I've added for instance above 4 syntactical elements:
Obviously there are more possible elements such as these and yes it is possible to individually change them in the JSON but I feel like this would make your already amazing library into something very powerful. The key is to make sure that these optional elements are very easy to use (like the library).
Thank you very much and have a great day.
It would be niece if you included view templates.
The pipedream.ai website says:
Create backend and frontend code in minutes using a simple sketch syntax. Get best practice predictions from 300 000 github repositories.
I am looking for how to create frontend code with pipedream.
Can someone help me find it?
Hi. First of all, I want to congrats the team on the effort of this awesome package. Can we have a feature to enable the acceptance tests of the controllers created from the schema? I think it's good to we've the acceptance tests just in time.
Best regards,
Calvin.
Ops! To get faster help you might want to supply the following:
Thank you!
First of all I want to tell you that this is an amazing idea!
I think that the "+ user system" button should also scaffold all views and styles, like "php artisan make:auth" does. Maybe also making it optional would be nice. What do you think about this?
In the laravel 6 i try to publish templates but cant generate any template
in 5.8 it was working
this is command to publish template i am using ( php artisan vendor:publish --tag=templates )
Thanks for impressive work. 👏 This will surely greatly speed up mocking new projects!! 👍
Cursor pointer when hovering the nav tabs would increase userfriendlieness a lot! 👆
https://tailwindcss.com/docs/cursor/#pointer
Tried to make PR but failed due to:
fatal: Authentication failed for 'https://[email protected]/pipe-dream/laravel.git/'
... maybe my fault I don't know but to tired to investigate but thought I'd leave it here if someone else reports the same issue.
Again, impressive and congratulations to the release!!! 🎉
Hi, I am getting this error: "Syntax error or access violation: 1067 Invalid default value for 'created_at" when I migrate the generated migrations.
If I replace the generated timestamp('created_at') and timestamp('updated_at') with timestamps() then this error is gone.
I am using Laravel 5.8.
This thread is for all contributors, want-to-be-contributors and also in specific response to @septIO and @adhikasp to discuss how to get to the next version of the pipe dream platform.
Preliminary time frames (open for discussion):
version | info | when |
---|---|---|
alpha | this repo at its current state | Released June 2019 |
beta 1 | implementation of the new platform including laravel support | September 2019 |
beta 2 | implementation of an additional 1-3 languages/frameworks | October 2019 |
V1 | more advanced features | 2020 |
We need to setup a scope all the way to beta 2
(with V1
somewhat in mind). How can we do that? The Trello board could potentially act as a guide using the columns:
But I'm sure there are better ways? Illustrations/wireframes? Feature list in google sheets? Suggestions needed!
make core/other module a proper ES6 module with webpack build, so we don't need to write workaround for things like jest and file loader.
This sounds good, I'm not that experienced with how to export the packages in a modular way, Im sure there are a lot of room for improvement from the initial package setup. 👍
... Core rewrite? I’ve read through it, and i see alot of optimization options, and some class/file names doesn’t always make sense as to what they do. I would also like to abstract each component further (as discussed on the GitHub issue). What are your thoughts of writing the core in TypeScript to ensure typesafety, and use some of the better parts of TypeScript such as private properties/methods, interfaces, traits etc.
I think we should pursue high quality, and all of this sounds like good ideas! 👍
resource | purpose |
---|---|
Trello | Overview work planning |
Issues in this or other repos | Detailed issue/dev discussion, since better than trello (?) |
pipedream docs | User/Developer docs + platform overview |
Pipe Dream is in a way abstractions of abstractions and I have a hard time wrapping my head around it all. I usually do a lot of sketches in a physical notepad, but thats not good enough. Maybe we also need some kind of vector modeling tool to explain ideas and make them commitable for documentation. Any ideas? I tried draw.io which is cool but maybe not that smart for application development?
Hi there !
I was trying to POC a way to implements validation rules for the fields but couldn't find the right way to write it in the first place.
Indeed, if we start to implement validation rules, we'll sure implement a all lot of other things.
Then I remembered JDL. According to jhipster.tech/jdl :
The JDL is a JHipster specific domain language where you can describe all your applications, deployments, entities and their relationships in a single file (or more than one) with a simple and user-friendly syntax.
It looks like that :
entity Post {
title String required minlength(5)
content TextBlob required min(150)
}
entity Comment {
content TextBlob required min(10)
}
relationship ManyToOne {
Post{user(login)} to User,
Comment{user(login)} to User,
}
relationship OneToMany {
Post{comment(comment) required} to Comment
}
paginate Post, Comment with infinite-scroll`
Maybe should we specify a Pipe Dream Domain Language.
It could not only describe all entities and relations but also commands to run, packages to install, etc.
What do you think ?
After writing any sketch ( or even using the sample one), I cans see that the json schema getting updated. However when I ever visit the "Review" or "Build" tab I get an empty page with "No files yet!"
MacOS Mojave 10.14.5
Laravel 5.8 (clean install)
PipeDream 0.0.45
Thank you!
In a fresh install of Laravel 7 you get a white screen due to a failure to load vendor JS & CSS resources
Hi
I think it would be better to replace this (automatically created by this package)
Route::resource('sliderLinks', 'SliderLinkAPIController', [
'only' => ['index', 'show', 'store', 'update', 'destroy']
]);
with this:
Route::apiResource('sliderLinks', 'SliderLinkAPIController');
When i add 'softdeletes' to a model it doesn't create the deleted_at field it just creates a text field softdeletes,wasn't it was added in v0.0.73?
system
windows 10 1909
xampp
php 7.3
"laravel/framework": "^6.2",
"pipe-dream/laravel-create": "^0.1.2",
input
Car
softdeletes
brand
color
user_id
Garage
location
capacity
car_garage
User
name
email
email_verified_at
password
remember_token
password_resets
email
token
output
[
{
"name": "Car",
"type": "ModelEntity",
"attributes": {
"id": {
"name": "id",
"cast": null,
"dataType": "bigIncrements",
"fillable": false,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"softdeletes": {
"name": "softdeletes",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"brand": {
"name": "brand",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"color": {
"name": "color",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"user_id": {
"name": "user_id",
"cast": null,
"dataType": "unsignedBigInteger",
"fillable": true,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": "users"
},
"created_at": {
"name": "created_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"updated_at": {
"name": "updated_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
}
},
"relationships": {
"hasOne": [],
"hasMany": [],
"belongsTo": [
"User"
],
"belongsToMany": [
"Garage"
]
}
},
{
"name": "Garage",
"type": "ModelEntity",
"attributes": {
"id": {
"name": "id",
"cast": null,
"dataType": "bigIncrements",
"fillable": false,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"location": {
"name": "location",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"capacity": {
"name": "capacity",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"created_at": {
"name": "created_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"updated_at": {
"name": "updated_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
}
},
"relationships": {
"hasOne": [],
"hasMany": [],
"belongsTo": [],
"belongsToMany": [
"Car"
]
}
},
{
"name": "car_garage",
"type": "PivotTableEntity",
"attributes": {
"id": {
"name": "id",
"cast": null,
"dataType": "bigIncrements",
"fillable": false,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"created_at": {
"name": "created_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"updated_at": {
"name": "updated_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"car_id": {
"name": "car_id",
"cast": null,
"dataType": "unsignedBigInteger",
"fillable": true,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": "cars"
},
"garage_id": {
"name": "garage_id",
"cast": null,
"dataType": "unsignedBigInteger",
"fillable": true,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": "garages"
}
},
"relationships": {
"hasOne": [],
"hasMany": [],
"belongsTo": [],
"belongsToMany": []
}
},
{
"name": "User",
"type": "UserEntity",
"attributes": {
"id": {
"name": "id",
"cast": null,
"dataType": "bigIncrements",
"fillable": false,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"name": {
"name": "name",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"email": {
"name": "email",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": true,
"foreign": null
},
"email_verified_at": {
"name": "email_verified_at",
"cast": "datetime",
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"password": {
"name": "password",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": true,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"remember_token": {
"name": "remember_token",
"cast": null,
"dataType": "string",
"fillable": false,
"hidden": true,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"created_at": {
"name": "created_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"updated_at": {
"name": "updated_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
}
},
"relationships": {
"hasOne": [],
"hasMany": [
"Car"
],
"belongsTo": [],
"belongsToMany": []
}
},
{
"name": "password_resets",
"type": "TableEntity",
"attributes": {
"id": {
"name": "id",
"cast": null,
"dataType": "bigIncrements",
"fillable": false,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"email": {
"name": "email",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"token": {
"name": "token",
"cast": null,
"dataType": "string",
"fillable": true,
"hidden": false,
"index": false,
"nullable": false,
"unique": false,
"foreign": null
},
"created_at": {
"name": "created_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
},
"updated_at": {
"name": "updated_at",
"cast": null,
"dataType": "timestamp",
"fillable": false,
"hidden": false,
"index": false,
"nullable": true,
"unique": false,
"foreign": null
}
},
"relationships": {
"hasOne": [],
"hasMany": [],
"belongsTo": [],
"belongsToMany": []
}
}
]
Add issue and pull request templates to project for easy feature request and bug reports
Hi,
I have much experience with code generators for vanilla php.
But with laravel this is my first time that I wanted to make code generation tools.
I came across laravel-create and I like it. But I would like to extend it to add my own ideas.
As I told I do not have experience with generating for laravel, I just searched laravel create, but could find the best place to extend it with my ideas.
Can you please tell me which files do I need to modify?
Once I get on to the track with what you have done, I will for sure contribute very much to laravel-create.
Thanks
Hi, first of all I'm sorry about the vague title (as a regular bug-report-submitter I'm ashamed).
I wanted to try it ASAP so I fired a laravel new
and fired up the /pipe-dream
url and then I found some things that didn't allow me to use it as-is without some changes, other stuff were impossible with just changing the templates:
___CASTS_BLOCK___
is missing from Model
but you do replace it in ModelPipe.jsThanks in advance! I hope to be using this tool in the future and forever!
Currently the order is automatically chosen to make sure that reference tables are made before the reference is declared on another table. This doesn't always work.
Can we make it so that we can manually change the order in the Preview area?
Tried out the supplied sample (e.g. with Car
, Garage
, etc.).
Observed that Garage
attribute capacity
has dataType
of 'string'
, instead of 'integer'
which was expected (and can be observed in the 2 minute demo video, where it was corrected to 'unsignedInteger'
).
Upon testing attributes that are present in the github.js
dump, I observed that the dataType almost always default to 'string'. The ruled
stuff seems to work, e.g. is_for_sale
resolves to 'boolean'
. But none of the github dumps work.
Tested on latest Laravel 6.14, Laravel 5.8, latest release of laravel-create (also tried older versions predating the move to core
and laravel-file-creator
, but to no avail.
On creating a project with the default settings, I noticed that the users table was created with a bigIncrements index (as per laravel 5.8 standard) but the cars table user_id column that references the bigInt was created with just an unsignedInteger, meaning that migration failed.
Suggest to either default to increments for id columns or make sure foreign key relationships have the correct type.
Brill project btw already planning on using it on a new site build
Hey ! nice work man! I love it, I make this package for laravel nova : https://github.com/cloudstudio/resource-generator and as we did here could be nice, configure some settings, like model folder, sometimes users use \App\Models\Model folder, what you think?
Cheers!
Currently you can set up you app, and then that's it. If we want to later make more models we'll have to add in the same sketch we used back then, make changes to the Schema and then to the templates (if any).
I want this to be possible (I'll check off items as they're implemented):
It would be useful to be able to specify sub-level model namespaces via the sketch area on the Object Model panel.
I know there's a plan to add model namespacing (as per #5) however, on a larger application, I often find it useful to create deeper namespaces.
These defined namespaces could be offset from the base model directory as defined in the FileFactory
modelNamespace
setting
As an example, assuming you've defined a model namespace as App\Models
and the build would place new models in app/Models
then defining a model as Users\Contractor
would create a Contractor
model in the app\Models\Users
directory with the namespace App\Models\Users
.
The one issue with this is how you manage relationships, but that could possibly be rectified by adding the ability to specify the model used for a foreign key.
e.g. with something like contractor_id:Users\Contractor
When adding the user system to the sketch, the remember_token isn't set to nullable => true.
I think it should be set to true by default otherwise it will cause errors !
(sorry for my trashy english !!!)
It would be great to add fold for the schema tab especially in case of a lot of data.
Like on the main example of ace editor
https://ace.c9.io/
Also add the validator files that will be inside app/Http/Requests
An example would be:
Car
id
name => required|min:3|max:255
And we would have a CarRequest.php file more or less like this:
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CarRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|min:3|max:255'
];
}
/**
* Mensagens caso pare nos rules atribuidos
* @return array
*/
public function messages() {
return [
'name.required' => 'The :attribute is required',
'name.min' => 'The :attribute ... :min',
'name.max' => 'The :attribute .... :max',
];
}
}
Since Closures can not be serialized, you can not cache your routes when you have routes which use closures.
on command artisan route:cache we get the following:
LogicException
Unable to prepare route [pipe-dream/api/save] for serialization. Uses Closure.
at vendor/laravel/framework/src/Illuminate/Routing/Route.php:1054
How to create one to one relationship on sketch, like many to many relationship use snake_case
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.