uff muchas cosas, agrege projecto y setup
This commit is contained in:
13
database/factories/ProjectsFactory.php
Normal file
13
database/factories/ProjectsFactory.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/* @var $factory \Illuminate\Database\Eloquent\Factory */
|
||||
|
||||
use App\Model;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Project::class, function (Faker $faker) {
|
||||
return [
|
||||
'title' => $faker->words(5, true),
|
||||
'md' => $faker->paragraphs(10, true)
|
||||
];
|
||||
});
|
||||
13
database/factories/SetupFactory.php
Normal file
13
database/factories/SetupFactory.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/* @var $factory \Illuminate\Database\Eloquent\Factory */
|
||||
|
||||
use App\Model;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Setup::class, function (Faker $faker) {
|
||||
return [
|
||||
'title' => $faker->words(5, true),
|
||||
'md' => $faker->paragraphs(10, true)
|
||||
];
|
||||
});
|
||||
@@ -28,7 +28,7 @@ class CreateBaseDb extends Migration
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('setup', function(Blueprint $table) {
|
||||
Schema::create('setups', function(Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('title');
|
||||
$table->longText('md');
|
||||
@@ -41,5 +41,6 @@ class CreateBaseDb extends Migration
|
||||
Schema::dropIfExists('projects');
|
||||
Schema::dropIfExists('now');
|
||||
Schema::dropIfExists('posts');
|
||||
Schema::dropIfExists('setups');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,7 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$this->call(PostTableSeeder::class);
|
||||
$this->call(NowTableSeeder::class);
|
||||
$this->call(SetupTableSeeder::class);
|
||||
$this->call(ProjectTableSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
11
database/seeds/ProjectTableSeeder.php
Normal file
11
database/seeds/ProjectTableSeeder.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ProjectTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
factory(App\Project::class, 50)->create();
|
||||
}
|
||||
}
|
||||
11
database/seeds/SetupTableSeeder.php
Normal file
11
database/seeds/SetupTableSeeder.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SetupTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
factory(App\Setup::class, 50)->create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user