【发布时间】:2020-10-01 20:01:04
【问题描述】:
我有一个问题。有谁知道这种情况下如何取id id
public function handle($request, Closure $next)
{
if($request->has('id')) {
$notification = auth()->user()->unreadNotifications()->where('I need put something here', $request->id)->first();
if($notification) {
$notification->markAsRead();
}
}
return $next($request);
}
我的表结构就像
编号:4
Notifiable_type 应用\用户
Notifiable_id 1
数据:{"evaluation_id":1} !!!这里是 $request->id 在我的情况下等于评估 ID 的点,我还需要从数据列中获取评估 ID 来比较它们并获取 ID
【问题讨论】:
-
你能告诉更多关于你的
Data : {"evaluation_id":1}你是如何在这里访问它的吗?基于此,只有我能帮你。
标签: laravel get notifications where-clause middleware