route的function拉出去
用cmder下建立controller
php artisan make:controller PostController
在App/Http/Controller/資料夾出現PostController.php
將route的function剪下貼在PostController.php
RESTful七個功能
GET /posts 取列表 index()
GEt /posts/id/edit 編輯表單 edit()
POST /posts 新增 store()
GET /posts/id 取一篇文章 show()
GET /post/create 秀出新增表單 create()
PUT/PATCH /posts/id 更新 update()
DELETE /posts/id 刪除 delete()
附註:
php artisan make:controller PostController --plan
空的
沒有留言:
張貼留言