Nie je mi jasne ako funguje select v Laravel resp. neviem ako ho spravne pouzit alebo je vela hodin. Ale k veci.
V WindrController je nieco taketo
public function create(Request $request, User $user, CoinpaymentsPaymentService $coinpaymentsPaymentService) {
$checkstatuswindraw = $user->account->related(Withdrawal::class)->where('status', '0')->first();
if (!empty($checkstatuswindraw))
$checkstatuswindraw = 'noepty';
if ($user->id != $request->user()->id)
abort(404);
return view('payments::frontend.pages.withdrawals.create', [
'account' => $user->account,
'enablewindraw' => $checkstatuswindraw,
'currencies' => $coinpaymentsPaymentService->getAcceptedCurrencies()
]);
}
mna zaujima tento riadok
$checkstatuswindraw = $user->account->related(Withdrawal::class)->where('status', '0')->first();
konkretnejsie related. Ako to spravit tak aby te related nebol Withdrawal::class ale napriklad table('deposit')?
Na co presne pouzijem ten related?
Ako by som inak v Laravel napisal select * from Withdrawal where status = 0 and where user = 'admin' ? Ked napisem
$checkstatuswindraw = DB::table('Withdrawal')->where('status', '0')->where('user', 'admin')->first(); hadze mi to 500.
preco?