Laravel-4-Generators

http://laravel.com/

http://kejyun.github.io/Laravel-4-Docum ... roduction/
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Laravel-4-Generators

文章 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
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Laravel-4-Generators

文章 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.
回覆文章

回到「laravel」