2013-04-03 21:14
浏览 45

Laravel 3 - RESTful API

How do I create the Routes for a RESTful API in Laravel 3?

I want to use GET, PUT, POST and DELETE in order to create an API.

I want all Routes to be prefixed with /v1/

So, I can do this: and just create the relevant controllers to check for Auth and perform actions.

图片转代码服务由CSDN问答提供 功能建议

如何在Laravel 3中为RESTful API创建路由?


我希望所有路由都以 / v1 / 为前缀

所以,我可以这样做: 并创建相关的控制器以检查Auth并执行操作。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • douhuan3420 2013-04-03 23:05

    I would suggest you using laravel 4 instead of laravel 3. Laravel 4 is really good at creating RESTful APIs and you can get started pretty fast. Here is a how to:

    Also watch this video if you are new to APIs

    What they suggest is passing parameters like so:

    I recently started of with developing a restful API service myself using laravel 4 and it is going pretty well so far. Also laravel 4 is said to release in May.

    解决 无用
    打赏 举报

相关推荐 更多相似问题