请给我一些使用laravel函数和laravel事件时的实际示例 任何帮助都可以申请, 衷心地感谢您不仅要工作,还要心底
答案 0 :(得分:0)
示例:
openTheDoor(){
//this is function
}
但是当有人敲门或门铃着火时,此功能将执行。
onDoorBell(){
//This is an event
openTheDoor();
}
实际示例
class RedirectIfAuthenticated
{
function checkUserIsActive(){
//Consider this a function
}
public function handle($request, Closure $next)
{
//this is an event fires when user loggedin
if(checkUserIsActive()){
//This is function
// Do something
}
}
}