Answer the question
In order to leave comments, you need to log in
Undefined variable what's wrong?
Gives an error Undefined variable: pays (View: /www/resources/views/admin/index.blade.php)
Controller
public function pays() {
$pays = DB::table('pay')
->select('pay.*', 'users.username')
->join('users', 'pay.uid', '=', 'users.id')
->where('uid', '>', '0')
->orderBy('buy_at', 'desc')
->get();
return view('admin.index', compact('pays'));
}
@forelse($pays as $pay)
<tr>
<td><a target="_blank" href=""></a></td>
<td></td>
</tr>
@empty
<center><h1 style="color: #33BDA6;"> нет!</h1></center>
@endforelse
Answer the question
In order to leave comments, you need to log in
This is not an error, but a warning. Set (perdivide) the $pays variable .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question