Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function toggleWinnerPublish($winner_id = null){
- if ($winner_id){
- $winner = Winners::find($winner_id);
- if ($winner){
- $redemption = Redemptions::find($winner->redemption_id);
- if ($redemption) {
- if ($winner->published) {
- $winner->published = 0;
- } else {
- $winner->published = 1;
- }
- $winner->save();
- HomeController::sendPublishMail($winner->id,$redemption->email);
- }
- }
- }
- return redirect('/winners');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement