Answer the question
In order to leave comments, you need to log in
Why does the debugger crash?
I don't understand what's the matter, in theory my function should work only when the time >= Carbon::now()
But... Most likely the reason is that laravel allocates the entire table via get() , despite the condition.
public function privil(Request $request)
{
$User = Auth::user();
$now = Carbon::now();
$quantity = 10;
$information = DB::table('role_user')->select('times', 'user_id')->get();
if($information->times >= $now) {
DB::table('users')->where($information->user_id, 'id')->update(['Money' => 10]);
}
return back()->with('success', ['Баланс успешно пополнен!']);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question