protected function saving(Eloquent $user, $input = [], $type = 'create')
    {
        $beforeEvent = ($type === 'create' ? 'creating' : 'updating');
        $afterEvent = ($type === 'create' ? 'created' : 'updated');

        $user->fullname = $input['fullname'];
        $user->email = $input['email'];

        $this->fireEvent($beforeEvent, [$user]);
        $this->fireEvent('saving', [$user]);

        $user->transaction(function () use ($user, $input) {
            $user->save();
            $user->roles()->sync($input['roles']);
        });

        $this->fireEvent($afterEvent, [$user]);
        $this->fireEvent('saved', [$user]);

        return true;
    }
protected function saving(Eloquent $user, $input = [], $type = 'create')
    {
        $beforeEvent = ($type === 'create' ? 'creating' : 'updating');
        $afterEvent = ($type === 'create' ? 'created' : 'updated');

        $user->fullname = $input['fullname'];
        $user->email = $input['email'];

        $this->fireEvent($beforeEvent, [$user]);
        $this->fireEvent('saving', [$user]);

        $user->transaction(function () use ($user, $input) {
            $user->save();
            $user->roles()->sync($input['roles']);
        });

        $this->fireEvent($afterEvent, [$user]);
        $this->fireEvent('saved', [$user]);

        return true;
    }
protected function saving ( Eloquent $ user , $ input = [ ] , $ type = 'create' ) { $ beforeEvent = ( $ type === 'create' ? 'creating' : 'updating' ) ; $ afterEvent = ( $ type === 'create' ? 'created' : 'updated' ) ; $ user -> fullname = $ input [ 'fullname' ] ; $ user -> email = $ input [ 'email' ] ; $ this -> fireEvent ( $ beforeEvent , [ $ user ] ) ; $ this -> fireEvent ( 'saving' , [ $ user ] ) ; $ user -> transaction ( function ( ) use ( $ user , $ input ) { $ user -> save ( ) ; $ user -> roles ( ) -> sync ( $ input [ 'roles' ] ) ; } ) ; $ this -> fireEvent ( $ afterEvent , [ $ user ] ) ; $ this -> fireEvent ( 'saved' , [ $ user ] ) ; return true ; }
Save the user.

@param  \Orchestra\Model\User  $user
@param  array  $input
@param  string  $type

@return bool
Save the user .