Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AuthController:
- protected function validator(array $data)
- {
- $accountType = AccountType::find($data['account_type_id']);
- if($accountType->name === "employer"){
- return Validator::make($data, [
- //employer validation
- ]);
- }else{
- return Validator::make($data, [
- //candidate validation
- ...
- ]);
- }
- }
- /**
- * Create a new user instance after a valid registration.
- *
- * @param array $data
- * @return User
- */
- protected function create(array $data)
- {
- // Check type of account
- $accountType = AccountType::find($data['account_type_id']);
- if($accountType->name === "employer"){
- //employer create
- }else{
- //Candidate user create
- }
- return $user;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement