$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',
];
public function rules()
{
return [
'phone_number' =>[
'required' ,
'unique:users,phone_number'
],
];
}