Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.

Overview

Laravel CRUD Generator

Build Status Total Downloads Latest Stable Version License

This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.

Requirements

Laravel >= 5.3
PHP >= 5.6.4

Installation

composer require appzcoder/crud-generator --dev

Documentation

Go through to the detailed documentation

Screencast

Screencast

If you're still looking for easier one then try this Admin Panel

Author

Sohel Amin 📧 Email Me

License

This project is licensed under the MIT License - see the License File for details

Comments
  • adding lots of new options!

    adding lots of new options!

    • Added --pagination option to the crud:generate and crud:controller options to change amount of models shown per page on index page, e.g. crud:generate --fields="...." --pagination=50
    • added --indexes option (see #102) e.g. crud:generate --fields="title#string,some_value#integer" --indexes="some_value" which will result in a migration of $table->index('some_value');. You can also do --indexes="some_value#unique" which will result in $table->unique('some_value');.
    • added --required-fields option to allow for required fields to be specified (this means it's now ignoring any #req or #required that may be defined in the fields string. This helps make the crud definition easier to write and understand. e.g. crud:generate --fields="title#string,value#integer" --required-fields="title". Fields that are not required will be set to nullable
    • added --foreign-keys option to migration and generate command. This will create references in the migration table only, and won't create any relationship functions in the model class - that will come next! e.g. --foreign-keys="owner_id#id#owners" where owner_id is the field name of the current table, id is the id column name on the related table, and owners is the related table name.
    • added --relationships option to auto-create relationship methods. This will create the necessary functions in the model class for relationships. Use; --relationships="relationshipName#relationshipType#argsSeparatedByPipes" where relationshipType is hasOne, belongsTo etc. User is responsible for ensuring the relationship is valid. The args will be split by pipe, and fed into the function. e.g. --relationships="owner#hasOne#App\Owner" This will create the function owner(){$this->hasOne('App\Owner');}. Notice that for each arg in the third section, single quotes will be wrapped around the string.
    • in crud:generate, changed --namespace argument to controller-namespace and also added a model-namespace for models
    • updated readme.md
    • pagination now uses 25 as the default instead of 15
    • added --form-validation option for specifying details of form validation for the html form. e.g. --form-validation="title#required|min:2|max:20,description#max:250
    opened by ChangePlaces 15
  • Fail execute command crud:generate

    Fail execute command crud:generate

    Message: Too many arguments, expected arguments "command" "name".

    Command: php artisan crud:generate Fornecedores --fields_from_file="/resources/crudGenerator/fornecedorFields" --view-path=admin --controller-namespace=Admin --route-group=admin form-helper=html

    My .json { "fields": [ { "name": "razao_social", "type": "string" }, { "name": "cnpj", "type": "text" }, { "name": "estado", "type": "select", "options": { "AC": "Acre", "AL": "Alagoas", "AP": "Amapá", "AM": "Amazonas", "BA": "Bahia", "CE": "Ceará", "DF": "Distrito Federal", "ES": "Espírito Santo", "GO": "Goiás", "MA": "Maranhão", "MT": "Mato Grosso", "MS": "Mato Grosso do Sul", "MG": "Minas Gerais", "PA": "Pará", "PB": "Paraíba", "PR": "Paraná", "PE": "Pernambuco", "PI": "Piauí", "RJ": "Rio de Janeiro", "RN": "Rio Grande do Norte", "RS": "Rio Grande do Sul", "RO": "Rondônia", "RR": "Roraima", "SC": "Santa Catarina", "SP": "São Paulo", "SE": "Sergipe", "TO": "Tocantins" } }, { "name": "cidade", "type": "text" }, { "name": "logradouro", "type": "select", "options": { "avenida": "Avenida", "alameda": "Alameda", "beco": "Beco", "rua": "Rua", "travessa": "Travessa", "viela": "Viela" } }, { "name": "complemento", "type": "text" }, { "name": "cep", "type": "text" }, { "name": "tel1", "type": "text" }, { "name": "tel2", "type": "text" }, { "name": "email", "type": "text" }, { "name": "responsavel", "type": "text" }, { "name": "user_id", "type": "integer#unsigned" } ], "validations": [ { "field": "responsavel", "rules": "required|max:15" }, { "field": "razao_social", "rules": "required|max:15" },{ "field": "email", "rules": "required|max:30" },{ "field": "complemento", "rules": "required|max:30" } ] }

    What the problem? Thankyou.

    opened by mfrancaleal 9
  • Enhancements

    Enhancements

    A few enhancements - happy to do PR's but want to make sure it lines up to your vision first.

    One

    At the moment it feels very much like a one use tool (it is a generator, so makes sense) - you run the generator, it creates everything and thats that. In reality though, I frequently add, modify and otherwise change models, migrations, etc.

    It would be good if this tool could account for that - much like Django's admin feature. There are a core set of models (this would be somewhat similar to your .json definitions), and from that everything is generated. The difference being that you can make updates to those core definitions and re-run the command and everything will update.

    If you do that with crud-generator it:

    • Doesn't update the controller
    • Doesn't update the model
    • Creates a new migration (so you end up with multiple migrations)
    • Updates the view

    So already, there are 3 possible outcomes (a "no update", a "new" and a "replace"). I understand not updating, but if that is desired, it should be the same for all.

    Ideally though, running update (possibly with a --force) would re-generate everything.

    So based on this - using models, possibly with some form of annotations instead of the .json would facilitate this. That way a user can update their models (and act as the source of truth), and migrations, controllers, and views are generated.

    Two

    A lot of awkward functionality is introduced by trying to get the CrudCommand to call the subcommands (joining relationships on '#' then splitting them back out). I suggest that you seperate out a set of service classes - one for each each command. Eg. CrudControllerService. In turn both CrudCommand and CrudControllerCommand invoke CrudControllerService, instead of CrudCommand trying to communicate directly with CrudControllerCommand via strings in the command line.

    Three

    And... this leads on to the third - relationships. It would be nice to start to introduce relationships (see attached image). Starting with belongsTo would be a good start - where instead of typing the id of the related model, a drop down would be used.

    I've tried to tackle this, but the passing relationship strings along the command line is becoming unweirdly (hence the request for the second feature above (services)).

    image

    Four

    Finally :) - How do you feel about using blade instead of the manual string replaces everywhere? For example: image

    The image is just really basic sample stuff - but it would really clean up the generators by not having to have str_replace everywhere.

    opened by cjke 9
  • No commands found in the

    No commands found in the "crud" namespace

    [Symfony\Component\Console\Exception\CommandNotFoundException]
    There are no commands defined in the "crud" namespace.

    When I run the generator. I ran the composer require and update, and updated my app.config file with the right providers and aliases.

    I also ran php artisan vendor:publish

    Any ideas

    opened by Ravenna 9
  • Crud-Generator without Form helper

    Crud-Generator without Form helper

    I rewrote everything to be able to use this plugin without the form helper. All fields have been replaced by normal fields and I used old() and isset() on variables in the edit field to maintain the form-model binding functionality

    opened by notflip 7
  • Bug in Usage part

    Bug in Usage part

    After passing the CRUD command : php artisan crud:generate Posts --fields='title#string; content#text; category#select#options={"technology": "Technology", "tips": "Tips", "health": "Health"}' --view-path=admin --controller-namespace=Admin --route-group=admin --form-helper=html

    I have the following error: Too many arguments expected arguments "command" "name".

    what does mean and what I should do to fix this error?

    opened by ibrahimbadram 6
  • Fixed file upload snippet to not treat file input like an array

    Fixed file upload snippet to not treat file input like an array

    The current views generated for file inputs don't facilitate arrays of file uploads, and so the handling of the file data can be greatly simplified (currently, when its treated as an array, its not working at all).

    Secondly, updated to use Laravel's built in store method as well as the built in hashName() method - this will make it far more consistent with how other files are uploaded

    Future enhancements would include the migrations for files creating multiple fields (original file name, path, mimetype, etc).

    opened by cjke 6
  • localize and locales not working

    localize and locales not working

    I am facing one problem, if you can suggest some solution. As mentioned on the home page, under Options sections, there are 2 options for localize and locales. I have used it but I did not see its working. May be I did something wrong. Can you please suggest how to make it work. I am using two languages english(ltr) and arabic(rtl).

    opened by MIdrees 6
  • More control over namespaces for model

    More control over namespaces for model

    It'd be awesome if you could specify a namespace for the model being generated. So far I've only been able to get them generated at App\SomeModel.php. A flag like --model-namespace=Models/Front/Blog that creates the model in that location. Otherwise, you need to move the model then edit its' templates and the controller to reference the new namespace.

    opened by pbehrens 6
  • Feature create config file

    Feature create config file

    I constantly use CrudGenerator for my packages and am always copying/pasting in a common config file. This would make config generation part of the crudgenerator process.

    opened by landjea 6
  • support composite indexes

    support composite indexes

    more of a note to myself, which I'll implement soon: e.g.:

    --pk="field1|field2" primary key on field1 and field2 --indexes="field1|field2,field3" composite index on field1 and field2, and another separate index on field3

    opened by ChangePlaces 5
  • Using route() instead of url()

    Using route() instead of url()

    Hi. Thanks for this very useful package. I believe that using the route() helper instead of url() would simplify a lot the templates. In principle I could use the route names instead the prefix, but because you append a / to the routeGroup option I have to modify the templates manually after I generate them. If you don't have time for this modification I could make a pull request when I can.

    opened by cdarken 1
  • Fork to Crud Generator

    Fork to Crud Generator

    Hi, I really like this generator. Then a create a fork and add my preferences to this:

    • Change
    <td>{{ $loop->iteration }}</td>
    

    to

    <td>{{ $item->id }}</td>
    

    in src/stubs/views/html/index.blade.stub

    • Change
    <table class="table">
    

    to

    <table class="table table-sm">
    

    in src/stubs/views/html/index.blade.stub

    • Add orderBy() to controller
    • Add folder includes in publish/views
    • and others
    opened by ribafs 1
  • Feature missing

    Feature missing

    I believe a feature to purge or rollback the changes is needed.

    Can you work on something like crud:rollback --tag=blog Also, add a feature to tag crud:generate command so to rollback.

    opened by vishal-sancheti 2
Releases(v3.3.1)
Basic Crud Generator (With Code Files, like GII (YII2)) Using Laravel, Livewire and Tailwind CSS

LiveCrud Live Crud Generator. This package generates Basic Crud with Livewire. Features Generate Complete Crud With Livewire Component and Blade Files

Ritesh Singh 28 Oct 12, 2022
This package provides an artisan command to generate a basic crud with Restful API support

NHRROB Crud Generator Package This package provides an artisan command to generate a basic crud composer install command: composer require nhrrob/crud

Nazmul Hasan Robin 22 Jun 24, 2022
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

Dwij IT Solutions 1.5k Dec 29, 2022
Prepare your Laravel apps incredibly fast, with various commands, services, facades and boilerplates.

Grafite Builder Grafite has archived this project and no longer supports or develops the code. We recommend using only as a source of ideas for your o

Grafite Inc 997 Dec 22, 2022
Laravel CRUD Generator, Make a Web Application Just In Minutes, Even With Less Code and fewer Steps !

?? CRUDBOOSTER - Laravel CRUD Generator Laravel CRUD Generator, Make a Web Application Just In Minutes, Even With Less Code and fewer Steps ! About CR

Crocodic Studio 1.7k Jan 8, 2023
⚡️ This package provides a wonderful PHP skeleton to start building your next package idea.

This package provides a wonderful PHP Skeleton to start building your next package idea. Requires PHP 8.0+ ⚡️ Create your package using Composer: comp

Nuno Maduro 383 Dec 20, 2022
Until 2018, Backpack v3 used this Base package to offer admin authentication and a blank admin panel using AdminLTE. Backpack v4 no longer uses this package, they're now built-in - use Backpack/CRUD instead.

Note: This package is only used by Backpack v3. Starting with Backpack v4, everything this package does is included in Backpack/CRUD - one package to

Backpack for Laravel 845 Nov 29, 2022
a laravel package to create dynamically dashboard views in several templates ( in development)

Laravel Dashboarder A laravel package for generate admin dashboard dynamically based on Tabler template use livewire - alpinejs Installation Run the c

Laravel Iran Community 7 Dec 12, 2022
A Laravel REST API backend with React/Redux, hot module reloading in development and route-level code splitting

React Laravel Boilerplate This is the boilerplate that I personally use for getting projects off the ground quickly using my favourite stack of techno

Carwyn Stephen 174 Jan 6, 2023
Start WordPress Plugin Development with React JS Package in just few steps

React Js & Wordpress Plugin Package Start WordPress Plugin Development with React JS Package in just few steps Getting Started with this Setup Clone t

Devang Vachheta 2 Aug 17, 2022
A package for building Admin-Interfaces that help maintaining the data of your applications

A package for building Admin-Interfaces that help maintaining the data of your applications. It provides an intuitive interface and the tools needed to manage your project's Users, Models and free Forms for Pages, Settings etc.

null 808 Dec 31, 2022
Laravel Package for crud generation

Crud and API Generator Package Package which let's you automate tedious CRUD Operations. Requirements Laravel Version: >= 8.0 PHP Version: >= 7.3 Comp

Niraj Basnyat(badass) 12 Mar 29, 2022
A super simple crud package for laravel

A super simple crud package for laravel

Ivan Preziosi 2 Feb 27, 2022
A CRUD app made with Laravel and VueJS 3 (API Composition)

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Ludovic Guénet 2 Apr 1, 2022
laravel adminlte with crud upload photo, ckeditor, validation & rest api

laravel crud with adminlte + restapi feature : Auth crud product (datatable, upload product using ajax, description with ckeditor) crud category displ

Dani 0 Jan 6, 2022
Projeto CRUD para gestão de clientes com consumo da API ViaCep

CRUD-Clientes-API Projeto CRUD para gestão de clientes com consumo da API ViaCep Requisitos PHP 7.4 MySQL Configuração do banco de dados Executar a qu

Bruno Vieira 4 Sep 8, 2022
🐳 Build a simple laravel development environment with docker-compose.

docker-laravel ?? Introduction Build a simple laravel development environment with docker-compose. Usage $ git clone [email protected]:ucan-lab/docker-la

ucan-lab 911 Jan 5, 2023
A template for web development using Laravel, Inertia and Svelte

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Atikur Rahman Chitholian 0 Dec 26, 2021
:computer: :octocat: A hackathon/MVP boilerplate for laravel web applications. Start your hackathons without hassle.

Laravel Hackathon Starter - SUSUMU 進 If you have attended any hackathons in the past, then you know how much time it takes to get a project started: d

Prosper Otemuyiwa 1.6k Dec 17, 2022