如何在 Laravel 4 中构建 REST API 并添加用户
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18680396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to build a REST API in Laravel 4 and add users
提问by user1013129
I am working with Laravel 4 attempting to build a REST API. I have to create a resourceful controller, model, and associated views for managing multiple api consumers. I want each api consumer to (at a minimum) have attributes for api_key and shared_secret. I have been reading Jeremy Kendall's page on Query Auth @ http://jeremykendall.net/2013/08/13/api-query-authentication-with-query-auth/. I am getting very confused. I do not understand where everything should go.
我正在使用 Laravel 4 尝试构建 REST API。我必须创建一个资源丰富的控制器、模型和关联视图来管理多个 api 使用者。我希望每个 api 使用者(至少)具有 api_key 和 shared_secret 的属性。我一直在阅读 Jeremy Kendall 关于 Query Auth @ http://jeremykendall.net/2013/08/13/api-query-authentication-with-query-auth/的页面。我很困惑。我不明白一切应该去哪里。
回答by assertchris
Here's a tutorial on user authentication: https://medium.com/on-coding/e8d93c9ce0e2
这是一个关于用户身份验证的教程:https: //medium.com/on-coding/e8d93c9ce0e2
Here's one on ACL: https://medium.com/on-coding/a7f2fa1f9791
这是 ACL 上的一个:https: //medium.com/on-coding/a7f2fa1f9791
And here's one on REST API's in L4: https://medium.com/on-coding/c643022433ad
这是 L4 中 REST API 的一个:https: //medium.com/on-coding/c643022433ad
回答by Junaid Qadir
I'd suggest you to watch the What's New in Laravel 4 seriesbefore doing any commando action.
我建议您在进行任何突击行动之前先观看Laravel 4 系列的新增功能。