agregada la opcion de published a los posts
This commit is contained in:
@@ -7,6 +7,7 @@ use Faker\Generator as Faker;
|
||||
$factory->define(App\Post::class, function (Faker $faker) {
|
||||
return [
|
||||
'title' => $faker->words(5, true),
|
||||
'md' => $faker->paragraphs(10, true)
|
||||
'md' => $faker->paragraphs(10, true),
|
||||
'is_published' => $faker->boolean
|
||||
];
|
||||
});
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePublishedRow extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('posts', function (Blueprint $table) {
|
||||
$table->boolean('is_published')
|
||||
->after('md')
|
||||
->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('posts', function (Blueprint $table) {
|
||||
$table->dropColumn('is_published');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user