★ wanayoo — archive 1999 https://github.com/corcel/corcel/pull/495Nouvelle recherche | Portail wanayoo
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
from

Conversation

@rodrigocalilo
Copy link

@rodrigocalilo rodrigocalilo commented Dec 19, 2019

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

Copy link
Member

@jgrossi jgrossi left a comment

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;

This comment has been minimized.

@jgrossi

jgrossi Jul 28, 2020
Member

make this a constant please

private const SHORT_CONTENT_CHAR_LIMIT = 400;
/**
* @return string
*/
public function getShortContentAttribute()

This comment has been minimized.

@jgrossi

jgrossi Jul 28, 2020
Member

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.