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

        $role->setAttribute('name', $input['name']);

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

        DB::transaction(function () use ($role) {
            $role->save();
        });

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

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

        $role->setAttribute('name', $input['name']);

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

        DB::transaction(function () use ($role) {
            $role->save();
        });

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

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

@param  \Orchestra\Model\Role  $role
@param  array  $input
@param  string  $type

@return bool
Save the role .