public function store($payload)
    {
        $payload['question'] = htmlentities($payload['question']);
        $payload['is_published'] = (isset($payload['is_published'])) ? (bool) $payload['is_published'] : 0;
        $payload['published_at'] = (isset($payload['published_at']) && !empty($payload['published_at'])) ? Carbon::parse($payload['published_at'])->format('Y-m-d H:i:s') : Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s');

        return $this->model->create($payload);
    }
public function store($payload)
    {
        $payload['question'] = htmlentities($payload['question']);
        $payload['is_published'] = (isset($payload['is_published'])) ? (bool) $payload['is_published'] : 0;
        $payload['published_at'] = (isset($payload['published_at']) && !empty($payload['published_at'])) ? Carbon::parse($payload['published_at'])->format('Y-m-d H:i:s') : Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s');

        return $this->model->create($payload);
    }
public function store ( $ payload ) { $ payload [ 'question' ] = htmlentities ( $ payload [ 'question' ] ) ; $ payload [ 'is_published' ] = ( isset ( $ payload [ 'is_published' ] ) ) ? ( bool ) $ payload [ 'is_published' ] : 0 ; $ payload [ 'published_at' ] = ( isset ( $ payload [ 'published_at' ] ) && ! empty ( $ payload [ 'published_at' ] ) ) ? Carbon :: parse ( $ payload [ 'published_at' ] ) -> format ( 'Y-m-d H:i:s' ) : Carbon :: now ( config ( 'app.timezone' ) ) -> format ( 'Y-m-d H:i:s' ) ; return $ this -> model -> create ( $ payload ) ; }
Stores FAQ into database.

@param array $payload

@return FAQ
Stores FAQ into database .