FEATURE: add number of views in page

This commit is contained in:
Michal Kváček
2016-09-20 01:04:23 +02:00
parent 7a681fd7f7
commit 8bd30d0301
3 changed files with 45 additions and 0 deletions
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddNumberOfViewsOfPage extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('contents', function (Blueprint $table) {
$table->integer('viewed')
->comment('How many times has been this content page displayed?')
->after('updated_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contents', function (Blueprint $table) {
$table->dropColumn('viewed');
});
}
}