New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

atnic/laravel-generator

Generator for Laravel Framework.
1,838 15
Install
composer require atnic/laravel-generator
Latest Version:v0.10.5
PHP:>=7.0
Laravel:5
License:MIT
Last Updated:Sep 21, 2022
Links: GitHub  ·  Packagist
Maintainer: frdteknikelektro

Laravel Generator

Installation

composer require atnic/laravel-generator

Make Module (CRUD)

This package is overriding some laravel artisan command.

This is example to make Foo module in this project

php artisan make:controller --model=Foo FooController

If create custom directory for model like this:

php artisan make:controller --model=App\\Models\\Foo FooController

Then do this steps:

  • Check new migration in database/migrations/, add column needed.
  • Check new factory in database/factories/, add atrribute needed.
  • Check new model in app/, add changes needed.
  • Check new filter in app/Filters/, do all TODO: and remove the comment if done.
  • Check lang en resources/lang/en and copy from en to lang id resources/lang/id, add language as needed.
  • Check new controller in app/Http/Controllers/, complete returned array in method relations() visibles() fields() rules(), do all TODO:, and remove comment if done.
  • Check new policy in app/Policies/, do all TODO: and remove the comment if done.
  • No need to append new Policy to $policies attribute in app/Providers/AuthServiceProvider.php. This package handle policy auto discovery, even for Laravel < 5.8.
  • Check new views (index, create, show, edit) in resources/views/, add/extend section for title or anything.
  • Check new tests in tests/Feature/, do all TODO: and remove the comment if done.

Other Useful command

#Creating Nested Controller
php artisan make:controller --parent=Foo --model=Bar Foo/BarController

#Creating Nested Controller with custom directory for model
php artisan make:controller --parent=App\\Models\\Foo --model=App\\Models\\Bar Foo/BarController

#Create Single Action Controller
php artisan make:controller DashboardController

#Creating Api Controller
php artisan make:controller-api --model=Foo FooController

#Creating Api Controller with custom directory for model
php artisan make:controller-api --model=App\\Models\\Foo FooController

#Creating Nested Controller API
php artisan make:controller-api --parent=Foo --model=Bar Foo/BarController

#Creating Nested Controller API with custom directory for model
php artisan make:controller-api --parent=App\\Models\\Foo --model=App\\Models\\Bar Foo/BarController

All new/overrided command can be viewed in vendor/atnic/laravel-generator/app/Console/Commands.

Related Packages

melihovv/laravel-package-generator

A laravel package generator

34,746 142
atnic/lumen-generator

Generator for Lumen Framework.

12 2
dgtlss/easyerd

A Laravel package to generate ERD diagrams from models and migrations

183 6
jackiedo/laravel-packager

A CLI tool to create packages for Laravel application.

1,279 5
rpvirtual/laravel-api-module

Generador de módulos API para Laravel (CRUD, servicios, providers, migraciones y...

5 0

Version History

Version Released PHP Laravel License
v0.10.5 >=7.0 ^5.5|^5.6|^5.7|^5.8 MIT
v0.10.4 >=7.0 >=5.5 MIT
v0.10.3 >=7.0 >=5.5 MIT
v0.10.2 >=7.0 >=5.5 <5.8 MIT
v0.10.1 >=7.0 >=5.5 <5.8 MIT