Skip to content

Commit

Permalink
updated migration to include title and body by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Trexology committed Nov 11, 2015
1 parent 7f160f1 commit e124553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions database/migrations/2015_10_24_10000_create_ratings_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public function up()
Schema::create('ratings', function (Blueprint $table) {
$table->increments('id');
$table->integer('rating');
$table->string('title');
$table->string('body');
$table->morphs('reviewrateable');
$table->morphs('author');
$table->timestamps();
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/ReviewRateable.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function ratingPercent($max = 5)
*/
public function rating($data, Model $author, Model $parent = null)
{
return (new Rating())->createReviewRateable($this, $data, $author);
return (new Rating())->createRating($this, $data, $author);
}

/**
Expand All @@ -71,7 +71,7 @@ public function rating($data, Model $author, Model $parent = null)
*/
public function updateRating($id, $data, Model $parent = null)
{
return (new Rating())->updateReviewRateable($id, $data);
return (new Rating())->updateRating($id, $data);
}

/**
Expand All @@ -81,6 +81,6 @@ public function updateRating($id, $data, Model $parent = null)
*/
public function deleteRating($id)
{
return (new Rating())->deleteReviewRateable($id);
return (new Rating())->deleteRating($id);
}
}

0 comments on commit e124553

Please sign in to comment.