Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added method getShortContentAttribute to Post Model #495

Open
wants to merge 2 commits into
base: 3.0
Choose a base branch
from

Conversation

rodrigocalilo
Copy link

The method returns the first 400 characters of the main content.

Copy link
Member

@jgrossi jgrossi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks man! added a few comments I'd like to discuss first before merging. thanks for the hard work 💪

src/Model/Post.php Outdated Show resolved Hide resolved
src/Model/Post.php Outdated Show resolved Hide resolved
/**
* @var int
*/
protected $characters = 400;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this a constant please

private const SHORT_CONTENT_CHAR_LIMIT = 400;

/**
* @return string
*/
public function getShortContentAttribute()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get you please add a test case in PostTest class to support this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants