1 頁 (共 1 頁)

Laravel-4-Generators

發表於 : 2014-11-02 20:51:16
yehlu
https://phphub.org/topics/27

代碼: 選擇全部

https://github.com/JeffreyWay/Laravel-4-Generators
app/config/app.php
'providers' => array(
add

代碼: 選擇全部

'Way\Generators\GeneratorsServiceProvider'

代碼: 選擇全部

php artisan generate:scaffold post --fields="title:string,content:text"
D:\UwAmp\www\laravel>php artisan generate:scaffold post --fields="title:string,c
ontent:text"


Do you want me to create a Post model? [yes|no] yes
Created: D:\UwAmp\www\laravel\app/models/Post.php
Do you want me to create views for this Post resource? [yes|no] yes
Created: D:\UwAmp\www\laravel\app/views/posts/index.blade.php
Created: D:\UwAmp\www\laravel\app/views/posts/show.blade.php
Created: D:\UwAmp\www\laravel\app/views/posts/create.blade.php
Created: D:\UwAmp\www\laravel\app/views/posts/edit.blade.php
Do you want me to create a PostsController controller? [yes|no] yes
Created: D:\UwAmp\www\laravel\app/controllers/PostsController.php
Do you want me to create a 'create_posts_table' migration and schema for this re
source? [yes|no] yes
Created: D:\UwAmp\www\laravel\app/database/migrations/2014_11_02_125753_create_p
osts_table.php
Generating optimized class loader
Compiling common classes
Compiling views
Would you like a 'Posts' table seeder? [yes|no] yes
Created: D:\UwAmp\www\laravel\app/database/seeds/PostsTableSeeder.php
Do you want to go ahead and migrate the database? [yes|no] yes
**************************************
* Application In Production! *
**************************************

Do you really wish to run this command? yes



[PDOException]
could not find driver



generate:scaffold [--fields[="..."]] resource

Re: Laravel-4-Generators

發表於 : 2014-11-07 15:30:24
yehlu
Z:\test\blog>php artisan generate:scaffold post --fields="title:string,content:t
ext"
Do you want me to create a Post model? [yes|no] yes
Created: Z:\test\blog\app/models/Post.php
Do you want me to create views for this Post resource? [yes|no] y
Created: Z:\test\blog\app/views/posts/index.blade.php
Created: Z:\test\blog\app/views/posts/show.blade.php
Created: Z:\test\blog\app/views/posts/create.blade.php
Created: Z:\test\blog\app/views/posts/edit.blade.php
Do you want me to create a PostsController controller? [yes|no] y
Created: Z:\test\blog\app/controllers/PostsController.php
Do you want me to create a 'create_posts_table' migration and schema for this re
source? [yes|no] y
Created: Z:\test\blog\app/database/migrations/2014_11_07_072916_create_posts_tab
le.php
Generating optimized class loader
Compiling common classes
Compiling views
Would you like a 'Posts' table seeder? [yes|no] y
Created: Z:\test\blog\app/database/seeds/PostsTableSeeder.php
Do you want to go ahead and migrate the database? [yes|no] y
**************************************
* Application In Production! *
**************************************

Do you really wish to run this command? n
Command Cancelled!
Done!
All done! Don't forget to add 'Route::resource('posts', 'PostsController');` to
app/routes.php.