8000 Added method getShortContentAttribute to Post Model by rodrigocalilo · Pull Request #495 · corcel/corcel · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@rodrigocalilo
Copy link

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

Copy link
Member
@jgrossi 8000 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 💪

/**
* @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.

3 participants

0