简体   繁体   中英

What is the difference between auth()->loginUsingId(1); vs Auth::loginUsingId(1);

What is the difference between auth()->loginUsingId(1); vs Auth::loginUsingId(1);

性能不会有差异,因为它们做的是相同的事情。

you will get the same results, but one of them you are calling a global function

https://github.com/laravel/framework/blob/5.2/src/Illuminate/Foundation/helpers.php#L136

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM