janareit/l5scaffold 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

janareit/l5scaffold

最新稳定版本:1.1.0

Composer 安装命令:

composer require janareit/l5scaffold

包简介

Extend Laravel 5's generators scaffold.

README 文档

README

This is a scaffold generator for Laravel 5.0.x.

This generator has less advanced features than my other forked generators set at https://github.com/janareit/laravel5generators. Check out both of them to see whic one better suits your project needs.

Usage

Step 1: Install Through Composer

composer require 'janareit/l5scaffold' --dev

Step 2: Add the Service Provider

This package scaffolds views using laracasts/flash package, so you need add also this to providers.

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

'janareit\L5scaffold\GeneratorsServiceProvider',
'Laracasts\Flash\FlashServiceProvider'

Add a facade alias to the same file at the bottom:

'Flash' => 'Laracasts\Flash\Flash'

Step 3: Run Artisan Command

php artisan vendor:publish

Step 4: Edit scaffolding config

Open config/scaffold.php and edit it according to your needs and wishes

Step 5: Run Artisan!

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

Command example

(--prefix option is OPTIONAL. Running command without it will simply skip prefix in folders)

php artisan make:scaffold Post --schema="title:string:default('Main title'), body:text" --prefix=Blog

This command will generate:

app/Repositories/Blog/Post.php
app/Http/Controllers/Blog/PostController.php
database/migrations/2015_06_03_234422_create_posts_table.php
database/seeds/Blog/PostTableSeeder.php
resources/views/blog/posts/index.blade.php
resources/views/blog/posts/show.blade.php
resources/views/blog/posts/edit.blade.php
resources/views/blog/posts/create.blade.php

And don't forget to run:

php artisan migrate

Step 6: Add route

Open routes.php and add route that you generated.

For example:

Route::resource('blog/posts', 'Blog\PostController');

Step 7: Add Route-Model binding

Add Route-Model binding and "use" clause to RouteServiceProvider.php

For example:

use App\Repositories\Blog\Post;

public function boot(Router $router)
	{
		parent::boot($router);

        $router->bind('posts', function($id) {
            return Post::findOrFail($id);
        });

	}

Scaffold

image image image

Thanks for all previous contributors but since fixing bugs and adding features according to my own need was very slow I forked this repo. Mainly for my own project needs:)

Love and greetings to all Laravel 5 fellows ot there:)

统计信息

  • 总下载量: 131
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 111
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-02