$results ]); } function register() { return view('register-policeman'); } function register_post() { $policeman = request()->validate([ 'badge_no' => 'required', 'embg' => 'required', 'password' => 'required', 'rank'=>'required' ]); $pe_id = DB::select('select pe_id from people where embg = :embg;', ['embg' => $policeman["embg"]]); DB::insert('INSERT INTO policeman (pe_id, badge_no, p_date_of_employment, rank, p_id, p_password) VALUES (?, ?, ?, ?, ?, ?)', [$pe_id[0]->pe_id, $policeman["badge_no"], Carbon::now()->format('Y-m-d'), $policeman["rank"], $policeSTATION,$policeman["password"]]); return view('register-policeman'); } }