Home  >  Article  >  Backend Development  >  laravel5的App目录下多了个service目录,是干啥用的?

laravel5的App目录下多了个service目录,是干啥用的?

WBOY
WBOYOriginal
2016-06-06 20:34:421685browse

在github上看了一些laravel5的demon, 发现很多人都没怎么用到这个service目录。

回复内容:

在github上看了一些laravel5的demon, 发现很多人都没怎么用到这个service目录。

这里很详细

http://laravel.com/docs/5.0/structure

难道是因为都看了我的教程?o(╯□╰)o

开个玩笑。

Laravel 4 时代这个 Services 文件夹都是自己建立的,用于放一些自定义工具类,如自定义验证,第三方工具库(加密、邮件短信等第三方SDK等等),自定义工具库(CURL等)等等,可以实现按需加载,取代之前的全局函数/静态函数。

Laravel 5 自带了一个 /app/Services 文件夹,里面写了一个系统自带的 Auth 的用户注册功能,本意跟上面一样:解耦

有个信息很关键 是5.0有 在5.1以后废除了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn