diff --git a/app/Article.php b/app/Article.php index f9e2d0f6..2ccabf72 100644 --- a/app/Article.php +++ b/app/Article.php @@ -85,12 +85,12 @@ public static function loadAllPublished(): Paginator * * @param string $slug * - * @return \App\Article + * @return Article */ public static function loadPublished(string $slug): Article { return static::with([ - 'user' => function (Builder $query) { + 'user' => function (BelongsTo $query) { $query->select('id', 'name'); }, ]) diff --git a/resources/js/common/wysiwyg-editor/index.js b/resources/js/common/wysiwyg-editor/index.js index f2fcbb5c..8822e52c 100644 --- a/resources/js/common/wysiwyg-editor/index.js +++ b/resources/js/common/wysiwyg-editor/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { EditorState, convertToRaw, ContentState, convertFromHTML } from 'draft-js' +import { ContentState, convertFromHTML, convertToRaw, EditorState } from 'draft-js' import { Editor } from 'react-draft-wysiwyg' import draftToHtml from 'draftjs-to-html' @@ -22,8 +22,8 @@ class WYSIWYG extends Component { this.onEditorStateChange = this.onEditorStateChange.bind(this) } - convertHtmlToEditorState(value) { - if (value){ + convertHtmlToEditorState = (value) => { + if (value) { const blocksFromHTML = convertFromHTML(value) const state = ContentState.createFromBlockArray( blocksFromHTML.contentBlocks, @@ -34,7 +34,7 @@ class WYSIWYG extends Component { } } - onEditorStateChange(editorState) { + onEditorStateChange = (editorState) => { this.setState({ editorState, }) @@ -43,14 +43,14 @@ class WYSIWYG extends Component { } render() { - const { editorState } = this.state + const {editorState} = this.state return (