Code Monkey home page Code Monkey logo

l5scaffold's Introduction

Laravel 5.x Scaffold Generator

Travis Packagist Tag

Usage

Step 1: Install Through Composer

composer require 'laralib/l5scaffold' --dev

Step 2: Add the Service Provider

Open config/app.php and, to your providers array at the bottom, add:

Laralib\L5scaffold\GeneratorsServiceProvider::class

Step 3: Run Artisan!

You're all set. Run php artisan from the console, and you'll see the new commands make:scaffold.

Examples

Use this command to generator scaffolding of Tweet in your project:

php artisan make:scaffold Tweet \
	--schema="title:string:default('Tweet #1'), body:text"

or with more options

php artisan make:scaffold Tweet \
	--schema="title:string:default('Tweet #1'), body:text" \
	--ui="bs3" \
	--prefix="admin"

This command will generate:

app/Tweet.php
app/Http/Controllers/TweetController.php

database/migrations/201x_xx_xx_xxxxxx_create_tweets_table.php
database/seeds/TweetTableSeeder.php

resources/views/layout.blade.php
resources/views/tweets/index.blade.php
resources/views/tweets/show.blade.php
resources/views/tweets/edit.blade.php
resources/views/tweets/create.blade.php

After don't forget to run:

php artisan migrate

Custom stub

Create a new folder inside Stubs > views with your UI name custom image

Custom fields in Stubs > views > **ui-name** > fields

Custom pages in Stubs > views > **ui-name** > pages


๐Ÿ’ญ Send us your ideas. (creating issues)

##Collaborators Fernando Brito
Sylvio Tavares
Raphael Heitor
Alfred Nutile
Sazzad Hossain Khan
Alexander Makhaev
Adam Brown
TJ Webb
Tsaganos Tolis
Ryan Gurnick

l5scaffold's People

Contributors

alnutile avatar cjwilburn avatar deftnerd avatar dev-force avatar fernandobritofl avatar hootlex avatar itsazzad avatar jonatastd avatar mankms avatar raphaelheitor avatar ryangurn avatar sylviot avatar webbtj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

l5scaffold's Issues

Command "make:scaffold" is not defined.

php artisan make:scaffold

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "make:scaffold" is not defined.

installed with:

composer require laralib/l5scaffold:master

added (config/app.php) :

Laralib\L5scaffold\GeneratorsServiceProvider::class,

Running on W10, EasyPHP Dev Server (Apache 2.4, PHP 7.1) and Laravel 5.4

unable to create scaffold

While the migration and seeder are created, it soon halts with this...

[InvalidArgumentException]
The "--no-migration" option does not exist.

Composer service provider issue

Can not add "Laralib\L5scaffold\GeneratorsServiceProvider" to app config provider

"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2."
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.
",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.|3.0.",
"symfony/dom-crawler": "2.8.|3.0.",
"laralib/l5scaffold": "^1.0"
},

Problem with ScaffoldMakeCommand

Hi,
When i installed the l5scaffold via composer with the specified command
composer require 'laralib/l5scaffold' --dev

My project starts to answer that

 [ReflectionException]
 Class Illuminate\Foundation\Composer does not exist

The package came with this line in the ScaffoldMakeCommand.php
use Illuminate\Foundation\Composer;

I just updated this line to fix this
use Illuminate\Support\Composer;

I think that the repository of composer has a messed up version of the package, just to alert you if you didn't know.

[]'s

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

Error Too many arguments, expected arguments "command" "name".
in command

php artisan make:scaffold Doctor \ --schema="name:string, crm:string, street:string, district:string, complement:string, postal_code:number, city:string, state:string"

blank schema

if no schema is specified I get:

  [ErrorException]            
  Array to string conversion 

custom templates

Hey... really nice idea

I was missing scaffold from way/generators badly and you made it.

as in original generators (way/generators).. do you have custom templates option?

Thanks.

[InvalidArgumentException]

[InvalidArgumentException]
Could not find package laralib\l5scaffold at any version for your minimum-stability (dev). Check the package spelling or your minimum-stability

The Route file

Hi,

Nice Project.

But I have a question about the routes. Do I have to adjust the route file for myself or can this scaffold generator do this automatically?

Error generating scaffold

Hello when I install the library for scaffold gives me the following error in laravel 5.1 ReflectionException]
Class Illuminate \ Support \ Composer does not exist

this-law run the command php artisan make: scaffold Tweet but I believe migration and seeder, unemployment does not go beyond that, does not create the models, or the views or controllers as say only laravel 5.1, I have not tried in laravel 5.2 or 5.3

Route naming (pluralization) issue in views.

Thanks for the great package! I'm coming from Rails and feel right at home :)

Ran into an issue with the views generation pluralizing the route name, resulting in:

Route [inventories.store] not defined.

Steps to reproduce:

  1. Install from master to workaround #9 - in composer.json
  "repositories": [
        {
            "type": "git",
            "url": "https://github.com/laralib/l5scaffold"
        }
    ],
    "require-dev": {
       "laralib/l5scaffold": "dev-master"
    },

and run:

$ composer update

  1. Generate Inventories scaffold. The exact command I ran is:

$ php artisan make:scaffold Inventory --schema="inventory_product:integer, sale_price:integer, quantity:integer"

I don't have time to fix the issue today but if anyone can give me a push in the right direction I may have time in the future.

UPDATE:

The erronious route name also appears in the controller.

Could not find package `laralib/l5scaffold` at any version for your minimum-stability (stable).

Hi! My Laravel Version is 5.2.29.
When i enter command in cmd:
composer requirelaralib/l5scaffold--dev
The cmd show me error:
[InvalidArgumentException] Could not find packagelaralib/l5scaffoldat any version for your minimum-stability (stable). Check the package spelling or your minimum-stability
2016-04-19_12-50-05
How i can install this package?
P.S. Other packages have been established successfully
Im sorry for my bad English:)

update old scaffolds

This tool is great for making scaffolds but they need to be essentially re-created or manually updated to take advantage of updated features, instead of excluding from the list of files to be created, could you make it so that the generated code is updated using the stubs and I suppose the differences like 'diff' but forcing new changes to overwrite if different.

scaffolding: Tweet undefined index: default

Hello, when i use make:scaffold command on laravel 5.4 can create Migration, Seed, Tweet and TweetController files correctly but can't create views throws a [ErrorException] Undefined index: default

captura

create.blade template

Quick build modules, as well as routing hints, your components are very easy to use.
Use the command on your readme.md document,generate create.blade.php template have a little issue.
line 30:
Create
revise ==>
Create

Thinkyou!

BootForm/FormBuilder support plus shared create/edit forms

It would be nice to have an option to use BootForm (and FormBuilder) for form generation.

I also find that it's common to share the credit/edit forms as there are very little differences other than "Add" vs "Edit", etc. How I do this is have a form.blade.php that create.blade.php and edit.blade.php sources via blade's at-include .

Route Group Prefix

It would be nice if you could supply a route group prefix as an optional parameter. So the views can use the correct route

readme instructions do not work

I followed the instructions in the readme for a brand new Laravel app. I did the following which did not end well. See the error message at the bottom.

$ laravel new myapp
...

$ cd myapp/

$ composer require 'laralib/l5scaffold' --dev
Using version ^1.0 for laralib/l5scaffold
./composer.json has been updated
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing laralib/l5scaffold (1.0.4)
    Loading from cache

Writing lock file
Generating autoload files
> php artisan optimize
Generating optimized class loader

$ vim config/app.php 

$ php artisan

  [ReflectionException]                                
  Class Illuminate\Foundation\Composer does not exist 

logout when switch beetwen routes

I use scafold route and laravel 5.3 web route

when I browse from admin panel that rotued by scafold and index page that routed by laravel 5.3 user logout and I need to login again

How should I solve this problem?

Problem with the installation

When I try to install i get this error in the console:


Script php artisan optimize handling the post-update-cmd event returned with error code 255

Installation failed, reverting ./composer.json to its original content.

I'm newbie in laravel...

POL.

Error create views: Undefined variable: schemaArray

I'm using laravel 5.2.x and an error occurred when creating views:

[ErrorException]
Undefined variable: schemaArray

Exception trace:
() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Makes/MakeView.php:144
Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Makes/MakeView.php:144
Laralib\L5scaffold\Makes\MakeView->replaceSchemaIndex() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Makes/MakeView.php:101
Laralib\L5scaffold\Makes\MakeView->compileViewStub() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Makes/MakeView.php:61
Laralib\L5scaffold\Makes\MakeView->generateView() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Makes/MakeView.php:37
Laralib\L5scaffold\Makes\MakeView->start() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Makes/MakeView.php:32
Laralib\L5scaffold\Makes\MakeView->__construct() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Commands/ScaffoldMakeCommand.php:181
Laralib\L5scaffold\Commands\ScaffoldMakeCommand->makeViews() at /var/www/html/blog/vendor/laralib/l5scaffold/src/Commands/ScaffoldMakeCommand.php:100
Laralib\L5scaffold\Commands\ScaffoldMakeCommand->fire() at n/a:n/a
call_user_func_array() at /var/www/html/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
Illuminate\Container\Container->call() at /var/www/html/blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
Illuminate\Console\Command->execute() at /var/www/html/blog/vendor/symfony/console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at /var/www/html/blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
Illuminate\Console\Command->run() at /var/www/html/blog/vendor/symfony/console/Application.php:791
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/blog/vendor/symfony/console/Application.php:186
Symfony\Component\Console\Application->doRun() at /var/www/html/blog/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /var/www/html/blog/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107
Illuminate\Foundation\Console\Kernel->handle() at /var/www/html/blog/artisan:36

Scaffold of nested resource

It would be good if one can specify that a scaffold one is creating is nested under another resource so that link to routes are created accordingly.

Instalation error

Hy All.

Is my first time using this package and it seems that there is an error after installation.

As Laravel's upgrade says:

"The Illuminate\Foundation\Support\Composer class has been moved to Illuminate\Support\Composer."

There's already a pull request for this: #82

Please update the master branch
Thanks

delete in show view doesn't work

The delete field ends up looking like this for any show view generated

<form action="#/$file->id"

Also, the hidden input fields were missing from the delete as well

_method and _token

#32

[ReflectionException]
Class Illuminate\Foundation\Composer does not exist for Laravel 5.2

"The Illuminate\Foundation\Support\Composer class has been moved to Illuminate\Support\Composer."

**Solution

change import class in Laralib\L5scaffold\Commands\ScaffoldMakeCommand by replace

Illuminate\Foundation\Composer;
to
use Illuminate\Support\Composer;

how to add this in laravel providers?

it would good if you provide the example config/app.php file so others can know how to add it i try like this

`/*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

    "Laralib\L5scaffold\GeneratorsServiceProvider"


    ],`

then run php artisan i get this error

[ReflectionException]
Class Illuminate\Foundation\Composer does not exist

How to configure layout?

I'd like to be able to configure the layout that the package uses to create the HTML. How can I make this happen?

Editing the files created by composer in the vendor folder is not an option since the layout would always be overridden when composer is updated... any ideas?

Thank you

Typing mistakes check?

I ran the following command which has a double space before has_parent:

php artisan make:scaffold Categories --schema="id:increments, name:string, has_parent:integer:unsigned, count:integer:unsigned"

Unfortunately the double space is now taken into account in the database field name. From the migration file:
$table->integer(' has_parent')->unsigned();
This also happens in the controller and the views.

This is a user mistake, but it would be nice if there was some sort of check to see if the input contains a valid field name.

Composer issue

I'm trying to install but :

[ReflectionException]
Class Illuminate\Foundation\Composer does not exist

Trait not found

When installed over a Laravel 5.4 installation, I get this message:

$ php artisan
[Symfony\Component\Debug\Exception\FatalErrorException]         
Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found 

I guess is something similar to this error laracasts/Laravel-5-Generators-Extended#125 (another package for extending artisan's make command.

Cant install this package

Hello, as the title says I cant install this package through composer.

I get an error saying:

Could not find package 'laralib/l5scaffold' at anyversion for your minimun -stability (stable). Check the package spelling or your minimum-stability

Problem with multi-word model names

Love the tool, HUGE time saver.

When generating a scaffold for a model with multiple words in the name (example "Email Message") the schema generation disagrees with Eloquent's standards for the table name. This examples creates a model called EmailMessage, and (without editing the migration) a table called emailmessages. Eloquent, by default expects the corresponding table to be snake case, so it expects email_messages.

Scaffold without migration

Is it possible to update the package and be able to create a scaffold without a migration? Sometimes I pull in packages that already publish their own migrations and making another boilerplate one isn't necessary. or at least --schema="". But that option needs a value

Route adding

Hi,

Do we have to define the route of I'm a facing an issue about routes ?

Getting error when trying to run scaffolding on Laravel 5.1

$ php artisan make:scaffold Tweet --schema="name:string"
Configuring Tweet...
Migration created successfully
Seed created successfully.



  [InvalidArgumentException]
  The "--no-migration" option does not exist.

Though I haven't pass any --no-migration command.

Is there any help?
Thanks in advance.

ui prefix

I could not find anything related --ui and code does not have anything related to it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.