if ($cd->total != 0) { $rate_thousand = $cd->total / 1000; if (isset($rate->id)) { $total_user_earnings += number_format($rate_thousand * $rate->rate, 2, '.', ''); } else { $total_user_earnings += number_format($rate_thousand * 0.2, 2, '.', ''); } } else { $total_user_earnings += number_format(0, 2, '.', ''); } } if ($total_user_earnings >= 10) { $npr = new PayRequest(); $npr->user_id = Auth::user()->id; $npr->email = Input::get('email'); $npr->save(); return Redirect::to('earn/cashout')->with(array('errors' => 'Request has been submitted!')); } else { return Redirect::to('earn/cashout')->with(array('errors' => 'Sorry, minimum cash out amount is $10!')); } } else { return Redirect::to('earn/cashout')->with(array('errors' => 'No email address specified!')); } } } }); Route::get('torrent/{uniid}', function ($uniid) { if (Auth::guest()) { return Redirect::guest('signin'); } else { $user_media = UserMedia::where('uni_id', '=', $uniid)->where('user_id', '=', Auth::user()->id)->first();