Menu

## PostDetail extends Model
in package
uses SoftDeletes

PostDetail.php : 29

Class PostDetail

Model for managing like/unlike/save details on posts.

##### Tags

mixin

### Table of Contents

#### Properties

$created_at : DateTime
$deleted_at : DateTime
$id : int
$like : int
$post : Post
$post_id : int
$save : int
$status : int
$unlike : int
$updated_at : DateTime
$user : User
$user_id : int
$dates : array<string|int, mixed>
  The attributes that should be mutated to dates.
$fillable : array<string|int, mixed>
  The attributes that are mass assignable.
$table : string
  The table associated with the model.

#### Methods

post() : BelongsTo
  Get the post this detail belongs to.
scopeByLikeCount() : int
  Get count of likes for a post.
scopeByUnlikeCount() : int
  Get count of unlikes for a post.
user() : BelongsTo
  Get the user who liked/unliked/saved this post.

### Properties

#### $created_at

PostDetail.php : 0
`public DateTime $created_at`

#### $deleted_at

PostDetail.php : 0
`public DateTime $deleted_at`

#### $id

PostDetail.php : 0
`public int $id`

#### $like

PostDetail.php : 0
`public int $like`

#### $post read-only

PostDetail.php : 0
`public Post $post`

#### $post_id

PostDetail.php : 0
`public int $post_id`

#### $save

PostDetail.php : 0
`public int $save`

#### $status

PostDetail.php : 0
`public int $status`

#### $unlike

PostDetail.php : 0
`public int $unlike`

#### $updated_at

PostDetail.php : 0
`public DateTime $updated_at`

#### $user read-only

PostDetail.php : 0
`public User $user`

#### $user_id

PostDetail.php : 0
`public int $user_id`

#### $dates

PostDetail.php : 56

The attributes that should be mutated to dates.

`protected array<string|int, mixed> $dates = ['deleted_at']`

#### $fillable

PostDetail.php : 47

The attributes that are mass assignable.

`protected array<string|int, mixed> $fillable = ['user_id', 'post_id', 'like', 'unlike', 'save', 'status']`

#### $table

PostDetail.php : 39

The table associated with the model.

`protected string $table = 'post_details'`

### Methods

#### post()

PostDetail.php : 73

Get the post this detail belongs to.

`public post() : BelongsTo`

##### Return values

BelongsTo

#### scopeByLikeCount()

PostDetail.php : 85

Get count of likes for a post.

`public scopeByLikeCount(Builder $query, int $post_id) : int`

##### Parameters

$query : Builder
$post_id : int

##### Return values

int

#### scopeByUnlikeCount()

PostDetail.php : 99

Get count of unlikes for a post.

`public scopeByUnlikeCount(Builder $query, int $post_id) : int`

##### Parameters

$query : Builder
$post_id : int

##### Return values

int

#### user()

PostDetail.php : 63

Get the user who liked/unliked/saved this post.

`public user() : BelongsTo`

##### Return values

BelongsTo

## Search results