Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers;
- use App\Models\Student;
- use Illuminate\Http\Request;
- class StudentCheckController extends Controller
- {
- /**
- * Show form for student first time verification
- */
- public function index()
- {
- return view('frontend.auth-check');
- }
- /**
- * Check student against set of questions
- */
- public function check(Request $request)
- {
- $student = Student::where('candidate_number', $request->input('candidate_number'))
- ->where('date_of_birth', $request->input('dob'))
- ->where('nok_phone_number', $request->input('nok_phone'))->first();
- if($student)
- {
- return view('frontend.register', array('student' => $student));
- }
- else
- {
- return redirect()->route('check.verify')->withInput()
- ->withErrors(['head'=>'Verification Failed', 'body'=>'All your responses are supposed to be correct (to match records you supplied earlier)']);;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement