在关注按钮的环节,用 debugbar 看到 gate 的 error 报错,该怎么理解?
就是访问自己的用户页面的时候(即没有关注按钮),会有
error
array:4 [▼
"ability" => "follow"
"result" => false
"user" => 101
"arguments" => "[0 => Object(App\Models\User)]"
]
而访问其他用户页面的时候(有关注按钮),会有
success
array:4 [▼
"ability" => "follow"
"result" => true
"user" => 101
"arguments" => "[0 => Object(App\Models\User)]"
]
这意思是通过了授权,也就是有关注权限的时候,显示success,反之显示error么
推荐文章: