common/services/entities/UserService.php
public function create( $model, $config = [] ) {

		$avatar = isset( $config[ 'avatar' ] ) ? $config[ 'avatar' ] : null;
		$banner = isset( $config[ 'banner' ] ) ? $config[ 'banner' ] : null;
		$video	= isset( $config[ 'video' ] ) ? $config[ 'video' ] : null;

		// Set Attributes
		$model->registeredAt = DateUtil::getDateTime();

		if( empty( $model->status ) ) {

			$model->status = User::STATUS_NEW;
		}

		if( empty( $model->type ) ) {

			$model->type = CoreGlobal::TYPE_DEFAULT;
		}

		if( empty( $model->slug ) ) {

			$model->slug = $model->username;
		}

		// Generate Tokens
		$model->generateVerifyToken();
		$model->generateAuthKey();
		$model->generateOtp();

		// Save Files
		$this->fileService->saveFiles( $model, [ 'avatarId' => $avatar, 'bannerId' => $banner, 'videoId' => $video ] );

		return parent::create( $model, $config );
	}
public function create( $model, $config = [] ) {

		$avatar = isset( $config[ 'avatar' ] ) ? $config[ 'avatar' ] : null;
		$banner = isset( $config[ 'banner' ] ) ? $config[ 'banner' ] : null;
		$video	= isset( $config[ 'video' ] ) ? $config[ 'video' ] : null;

		// Set Attributes
		$model->registeredAt = DateUtil::getDateTime();

		if( empty( $model->status ) ) {

			$model->status = User::STATUS_NEW;
		}

		if( empty( $model->type ) ) {

			$model->type = CoreGlobal::TYPE_DEFAULT;
		}

		if( empty( $model->slug ) ) {

			$model->slug = $model->username;
		}

		// Generate Tokens
		$model->generateVerifyToken();
		$model->generateAuthKey();
		$model->generateOtp();

		// Save Files
		$this->fileService->saveFiles( $model, [ 'avatarId' => $avatar, 'bannerId' => $banner, 'videoId' => $video ] );

		return parent::create( $model, $config );
	}
public function create ( $ model , $ config = [ ] ) { $ avatar = isset ( $ config [ 'avatar' ] ) ? $ config [ 'avatar' ] : null ; $ banner = isset ( $ config [ 'banner' ] ) ? $ config [ 'banner' ] : null ; $ video = isset ( $ config [ 'video' ] ) ? $ config [ 'video' ] : null ; // Set Attributes $ model -> registeredAt = DateUtil :: getDateTime ( ) ; if ( empty ( $ model -> status ) ) { $ model -> status = User :: STATUS_NEW ; } if ( empty ( $ model -> type ) ) { $ model -> type = CoreGlobal :: TYPE_DEFAULT ; } if ( empty ( $ model -> slug ) ) { $ model -> slug = $ model -> username ; } // Generate Tokens $ model -> generateVerifyToken ( ) ; $ model -> generateAuthKey ( ) ; $ model -> generateOtp ( ) ; // Save Files $ this -> fileService -> saveFiles ( $ model , [ 'avatarId' => $ avatar , 'bannerId' => $ banner , 'videoId' => $ video ] ) ; return parent :: create ( $ model , $ config ) ; }
Create the user and associate avatar, banner or video.

@param User $model
@param array $config
@return User
Create the user and associate avatar banner or video .