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

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

        $content = new Eloquent();
        $content->setAttribute('type', $input['type']);
        $content->setAttribute('user_id', $this->user->id);

        $listener->authorize('create', $content);

        $this->saving($content, $input);

        return $listener->storeHasSucceed($content, $input);
    }
public function store(Listener $listener, array $input)
    {
        $input['slug'] = $this->generateUniqueSlug($input);
        $validation    = $this->validator->on('create')->with($input);

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

        $content = new Eloquent();
        $content->setAttribute('type', $input['type']);
        $content->setAttribute('user_id', $this->user->id);

        $listener->authorize('create', $content);

        $this->saving($content, $input);

        return $listener->storeHasSucceed($content, $input);
    }
public function store ( Listener $ listener , array $ input ) { $ input [ 'slug' ] = $ this -> generateUniqueSlug ( $ input ) ; $ validation = $ this -> validator -> on ( 'create' ) -> with ( $ input ) ; if ( $ validation -> fails ( ) ) { return $ listener -> storeHasFailedValidation ( $ validation -> getMessageBag ( ) ) ; } $ content = new Eloquent ( ) ; $ content -> setAttribute ( 'type' , $ input [ 'type' ] ) ; $ content -> setAttribute ( 'user_id' , $ this -> user -> id ) ; $ listener -> authorize ( 'create' , $ content ) ; $ this -> saving ( $ content , $ input ) ; return $ listener -> storeHasSucceed ( $ content , $ input ) ; }
Store new content.

@param  \Orchestra\Story\Contracts\Listener\Content  $listener
@param  array  $input

@return mixed
Store new content .