public function store($listener, array $input)
    {
        $validation = $this->validator->on('create')->with($input);

        if ($validation->fails()) {
            return $listener->storeValidationFailed($validation);
        }

        $role = $this->model;

        try {
            $this->saving($role, $input, 'create');
        } catch (Exception $e) {
            return $listener->storeFailed(['error' => $e->getMessage()]);
        }

        return $listener->storeSucceed($role);
    }
public function store($listener, array $input)
    {
        $validation = $this->validator->on('create')->with($input);

        if ($validation->fails()) {
            return $listener->storeValidationFailed($validation);
        }

        $role = $this->model;

        try {
            $this->saving($role, $input, 'create');
        } catch (Exception $e) {
            return $listener->storeFailed(['error' => $e->getMessage()]);
        }

        return $listener->storeSucceed($role);
    }
public function store ( $ listener , array $ input ) { $ validation = $ this -> validator -> on ( 'create' ) -> with ( $ input ) ; if ( $ validation -> fails ( ) ) { return $ listener -> storeValidationFailed ( $ validation ) ; } $ role = $ this -> model ; try { $ this -> saving ( $ role , $ input , 'create' ) ; } catch ( Exception $ e ) { return $ listener -> storeFailed ( [ 'error' => $ e -> getMessage ( ) ] ) ; } return $ listener -> storeSucceed ( $ role ) ; }
Store a role.

@param  object  $listener
@param  array   $input

@return mixed
Store a role .