• Stars
    star
    240
  • Rank 168,229 (Top 4 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 5 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Laravel package to help you generate nearly complete CRUD pages like crazy!

Cray For Laravel

Latest Stable Version Latest Unstable Version Daily Downloads Total Downloads Quality Score License PHP Version Require

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 and PostUpdateRequest.php
  • Timestamped create_posts_table.php migration file
  • PostFactory.php
  • posts views directory with index.blade.php, create.blade.php, edit.blade.php, show.blade.php, modals/delete.blade.phpas 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 [email protected] 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.

More Repositories

1

branch

Branch Starter Theme - A WordPress starter theme based on Timber library and Bootstrap
HTML
88
star
2

font-os

font-os is an icon font containing Operating System logos to be used on your website.
HTML
28
star
3

blade-components

Reusable, self-contained Blade Components package for Laravel.
Blade
9
star
4

awe-theme

Article link: https://junaidqadir.com/build-wordpress-timber-bootstrap-theme-scratch/
Twig
7
star
5

mep-feature-playlist

A playlist plugin for MediaElementjs
JavaScript
5
star
6

laravel-crud-scaffold

A Laravel package to help you generate nearly complete CRUD pages like crazy!
PHP
5
star
7

Bookmarklet-Boilerplate

A Boilerplate for making bookmarklet development workflow simple
JavaScript
4
star
8

unibal2sayad

An experimental UniBal Script to Sayad script conversion tool
JavaScript
3
star
9

livewire-bootstrap-base

Base for creating apps for Timbercasts video series
PHP
3
star
10

Balochi-Wordlists

A Collection of text files with Balochi words in Sayad and UniBal scripts.
2
star
11

InkExport

A Bash script that exports selected objects from a svg to multiple resolution icons for android.
Shell
2
star
12

bootstrap-tab-wizard

A jQuery plugin to enhance a Bootstrap Tab component to a wizard.
JavaScript
1
star
13

notify

Bootstrap3 notifications for PHP
PHP
1
star
14

tailwind-play-api

PHP
1
star
15

builtwithnativephp

Built WIth NativePHP app store
Blade
1
star
16

ddd-php

Domain-Driven Design Implementation In PHP, Hexagonal Architecture to be precise.
PHP
1
star
17

timbercasts-e02-contacts

E02: Contact List with Livewire and Bootstrap
PHP
1
star
18

timbercast-s01e01-todo

Watch Me Build A ToDo App Using Laravel Livewire And Bootstrap
PHP
1
star
19

timbercast-s01e03-poll

E03: Twitter Poll
PHP
1
star