public function postRemovePicture() { $record = MagicQuestion::first(); if ($record) { if (!empty($record->picture)) { File::delete($record->picture); } $record->picture = ""; $record->save(); echo "1"; } else { echo "0"; } }
public function postSecretAnswer($lang = 'id') { $answer = Input::get('answer'); if ($answer) { $question = MagicQuestion::first(); $match = $question->answer_id; if ($lang == 'en') { $match = $question->answer_en; } if (strtolower(trim($answer)) == strtolower(trim($match))) { //correct answer Session::put('RR-secret', 0); } } //wrong answer or invalid request return Redirect::route('site.product.secret', array('lang' => $lang)); }