以 PostController 控制器的每个方法都有对应的请求方式、路由命名、URL、方法名和业务逻辑约定。

HTTP请求方式 URL 控制器方法 路由命名 业务逻辑描述
GET post index() post.index 展示所有文章
GET post/create create() post.create 发布文章表单页面
POST post store() post.store 获取表单提交数据并保存新文章
GET post/{id} show() post.show 展示单个文章
GET post/{id}/edit edit() post.edit 编辑文章表单页面
PUT post/{id} update() post.update 获取编辑表单输入并更新文章
DELETE post/{id} destroy() post.destroy 删除单个文章

相关文章:

  • 2022-12-23
  • 2019-11-02
  • 2022-01-17
  • 2021-08-17
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案