📜  此 ID 不存在验证 laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:24.193000             🧑  作者: Mango

代码示例1
$e = Subscription::find($request->subscription_id);
$rules = [
  'subscription_id' => 'required|integer|exists:subscriptions,id',
  'date' => 'required|date|after:yesterday',
  'date' => Rule::unique('member_attendances')->where(function ($query) use ($e) {
              return $query->where('member_id', $e->member_id);
})
//|unique:member_attendances,date,'.$e->member_id . ',member_id',
];