jq / cray
A disposable Laravel package to help you generate nearly complete CRUD pages like crazy!
Installs: 969
Dependents: 0
Suggesters: 0
Security: 0
Stars: 240
Watchers: 11
Forks: 17
Open Issues: 0
Requires
- php: >=7.2
- doctrine/dbal: ^3.3.4
- laravel/framework: ^6.0|^7.0|^8.0|^9.0|^10
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: ^4.0|^5.0|v6.0.0
- phpunit/phpunit: ^8.0|^9.0
- dev-master
- v3.2.0-beta8
- v3.2.0-beta7
- v3.2.0-beta6
- v3.2.0-beta5
- v3.2.0-beta4
- v3.2.0-beta3
- v3.2.0-beta2
- v3.2.0-beta
- v3.1.1
- v3.1.0
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.4
- 1.0.3
- dev-analysis-b0oBlA
- dev-analysis-neo1Ag
- dev-analysis-Znr1vD
- dev-analysis-0gYVWm
- dev-analysis-e753n2
- dev-analysis-yvy23D
- dev-analysis-ZlY5Yb
- dev-jq/bugfix-7
- dev-jq/bugfix-5
- dev-beta
- dev-6x
- dev-add-license-1
This package is auto-updated.
Last update: 2024-10-26 10:03:59 UTC
README
What is Cray?
Cray is a disposable
Laravel package to help you generate nearly complete CRUD pages like crazy. Literally. It's also a bit opinionated.
If you build straight-forward CRUD pages more often manually writing all the same logic becomes a chore. Cray will not only save you a save but also give you a better way to organize your code.
So what do you mean by disposable?
You use Cray and forget about it. It isn't coupled with your installation of Laravel and it is preferred to be installed as a dev
dependency. Cray generates the files and it forgets about them and they are all yours to modify do whatever you want.
What does it actually do?
Suppose you are building a blog, and you want to create a Post model then you have to do a ton of other tedious and to be honest, boring things like creating migrations, model factories, the controller, form validation and adding all the logic and what not.
So what Cray does is when you tell it the model name, it will do all those boring things I listed earlier. When it's done you have the following:
Post.php
PostController.php
with all the necessary logic to list, edit, create and delete posts.PostStoreRequest.php
andPostUpdateRequest.php
- Timestamped
create_posts_table.php
migration file PostFactory.php
posts
views directory withindex.blade.php
,create.blade.php
,edit.blade.php
,show.blade.php
,modals/delete.blade.php
as well as a blank_form.blade.php
for you to add the fields.
Then all you have to do is:
- Add the columns to the migration file
- Add the necessary fields (as defined in the last step) to the
_form.blade.php
- Add validation rules for the fields you added to the form.
Installation
composer require jq/cray --dev
Or specify specific version, for example to try a beta
composer require "jq/cray:3.2.0-beta3" --dev
Then publish the stubs
php artisan vendor:publish --tag=cray
It will generate stubs
to resources/vendor/cray/stubs
directory.
Usage
php artisan cray Post
Once done, it will show you the details of the files generated.
Factory created successfully in /database/factories/PostFactory.php Created Migration: 2020_03_14_151409_create_posts_table Model created successfully in /app/Post.php Controller created successfully in /app/Http/Controllers/PostController.php View created successfully in /resources/views/posts/index.blade.php View created successfully in /resources/views/posts/create.blade.php View created successfully in /resources/views/posts/_form.blade.php View created successfully in /resources/views/posts/edit.blade.php View created successfully in /resources/views/posts/show.blade.php View created successfully in /resources/views/posts/modals/delete.blade.php Request created successfully in /app/Http/Requests/PostStoreRequest.php Request created successfully in /app/Http/Requests/PostUpdateRequest.php
Now add the necessary fields and run
php artisan migrate
And that saved you an hour worth of repetitive and boring work which you can spend on more important development challenges.
Optional Packages
Documentation
You can read the documentation here.
Changelog
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email junaidqadirb@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.