kambuku/app/Http/Controllers/Auth/AuthController.php
/**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
Create a new user instance after a valid registration.
@param  array  $data
@return User
Create a new user instance after a valid registration . @param array $data @return User
protected function create(array $data)
    {
        if ($data['gender'] == 'm'){
            $default_image = 'images/uploads/avatars/defaults/male.png';
        }else{
            $default_image = 'images/uploads/avatars/defaults/female.png';
        }
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'gender' => $data['gender'],
            'date_of_birth' => Carbon::parse($data['date_of_birth']),
            'password' => bcrypt($data['password']),
            'is_active' => '1',
            'image_path' => $default_image,
        ]);
    }
protected function create ( array $ data ) { if ( $ data [ 'gender' ] == 'm' ) { $ default_image = 'images/uploads/avatars/defaults/male.png' ; } else { $ default_image = 'images/uploads/avatars/defaults/female.png' ; } return User :: create ( [ 'name' => $ data [ 'name' ] , 'email' => $ data [ 'email' ] , 'gender' => $ data [ 'gender' ] , 'date_of_birth' => Carbon :: parse ( $ data [ 'date_of_birth' ] ) , 'password' => bcrypt ( $ data [ 'password' ] ) , 'is_active' => '1' , 'image_path' => $ default_image , ] ) ; }
Create a new user instance after a valid registration.
Create a new user instance after a valid registration .