Permalink
Browse files

add accessor for pivot timestamp informaiton

  • Loading branch information...
taylorotwell committed Dec 1, 2017
1 parent 6e43aeb commit cbe8123a479e81779cd85251eb4a5cf861e93ea3
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -75,6 +75,13 @@ class BelongsToMany extends Relation
*/
protected $pivotWhereIns = [];
/**
* Indicates if timestamps are available on the pivot table.
*
* @var bool
*/
public $withTimestamps = false;
/**
* The custom pivot table column for the created_at timestamp.
*
@@ -877,6 +884,8 @@ public function getRelationCountHash()
*/
public function withTimestamps($createdAt = null, $updatedAt = null)
{
$this->withTimestamps = true;
$this->pivotCreatedAt = $createdAt;
$this->pivotUpdatedAt = $updatedAt;

0 comments on commit cbe8123

Please sign in to comment.