Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

laravel5.4 session set应该改为put #5

Closed
moore0903 opened this issue Mar 13, 2017 · 4 comments
Closed

laravel5.4 session set应该改为put #5

moore0903 opened this issue Mar 13, 2017 · 4 comments

Comments

@moore0903
Copy link

安神,你好,laravel5.4中,session的set()方法应该更换成put()

引用5.4中的升级说明
Symfony兼容性#

Laravel 的会话处理程序不再实现 Symfony 的 SessionInterface 。 实现这个接口需要我们实现框架不需要的无关特性。取而代之,已经定义了新的 Illuminate\Contracts\Session\Session 接口,并且可以使用。还应该修改一下代码:

所有调用 ->set() 方法应该更改为 ->put() 。通常,Laravel 应用从不调用 set 方法,因为它从未在 Laravel 文档中记录。不过,谨慎起见,这里我们依然罗列出来。

所有调用 ->getToken() 方法的地方需要修改为 ->token() 。

所有调用 $request->setSession() 方法的地方需要求改为 setLaravelSession() 。

@overtrue
Copy link
Owner

@overtrue
Copy link
Owner

所有调用 ->getToken() 方法的地方需要修改为 ->token() 。
所有调用 $request->setSession() 方法的地方需要求改为 setLaravelSession() 。

这是在说哪里?

@moore0903
Copy link
Author

哦哦,我没看git上的代码,应该用dev的,这两个我也没看到,只是从升级说明复制的一大段

@overtrue
Copy link
Owner

@moore0903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants