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)
    {
        \DB::beginTransaction();
        $user = User::create([
            'name'         => $data['name'],
            'email'        => $data['email'],
            'password'     => bcrypt($data['password']),
            'socket_token' => str_random(60),
        ]);
        $profile = UserProfile::create([
            'user_id'    => $user->id,
            'first_name' => $data['first_name'],
            'last_name'  => $data['last_name'],
            'country_id' => $data['country'],
            'city'       => $data['city'],
            'birth_date' => Carbon::parse($data['birth_date']),
            'service_start_date' => Carbon::parse($data['service_start_date']),
            'service_end_date'   => Carbon::parse($data['service_end_date']),
            'service_country_id' => $data['service_country'],
            'service_city'       => $data['service_city'],
        ]);
        $user->addProfilePicture($data['image']);
        \DB::commit();
        return $user;
    }
protected function create ( array $ data ) { \ DB :: beginTransaction ( ) ; $ user = User :: create ( [ 'name' => $ data [ 'name' ] , 'email' => $ data [ 'email' ] , 'password' => bcrypt ( $ data [ 'password' ] ) , 'socket_token' => str_random ( 60 ) , ] ) ; $ profile = UserProfile :: create ( [ 'user_id' => $ user -> id , 'first_name' => $ data [ 'first_name' ] , 'last_name' => $ data [ 'last_name' ] , 'country_id' => $ data [ 'country' ] , 'city' => $ data [ 'city' ] , 'birth_date' => Carbon :: parse ( $ data [ 'birth_date' ] ) , 'service_start_date' => Carbon :: parse ( $ data [ 'service_start_date' ] ) , 'service_end_date' => Carbon :: parse ( $ data [ 'service_end_date' ] ) , 'service_country_id' => $ data [ 'service_country' ] , 'service_city' => $ data [ 'service_city' ] , ] ) ; $ user -> addProfilePicture ( $ data [ 'image' ] ) ; \ DB :: commit ( ) ; return $ user ; }
Create a new user instance after a valid registration.
Create a new user instance after a valid registration .