muchas cosas, aun esta en proceso de construccion

This commit is contained in:
Daniel Cortés
2019-06-23 00:09:30 -04:00
parent a3a974d750
commit 110b0a07fc
23 changed files with 271 additions and 981 deletions

View File

@@ -0,0 +1,11 @@
<?php
/* @var $factory \Illuminate\Database\Eloquent\Factory */
use Faker\Generator as Faker;
$factory->define(App\Now::class, function (Faker $faker) {
return [
'md' => $faker->paragraphs(10, true)
];
});

View File

@@ -0,0 +1,12 @@
<?php
/* @var $factory \Illuminate\Database\Eloquent\Factory */
use Faker\Generator as Faker;
$factory->define(App\Post::class, function (Faker $faker) {
return [
'title' => $faker->words(5, true),
'md' => $faker->paragraphs(10, true)
];
});

View File

@@ -1,27 +0,0 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Illuminate\Support\Str;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBaseDb extends Migration
{
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title');
$table->longText('md');
$table->timestamps();
});
Schema::create('now', function(Blueprint $table) {
$table->bigIncrements('id');
$table->longText('md');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('now');
Schema::dropIfExists('posts');
}
}

View File

@@ -4,13 +4,9 @@ use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
$this->call(PostTableSeeder::class);
$this->call(NowTableSeeder::class);
}
}

View File

@@ -0,0 +1,11 @@
<?php
use Illuminate\Database\Seeder;
class NowTableSeeder extends Seeder
{
public function run()
{
factory(App\Post::class, 50)->create();
}
}

View File

@@ -0,0 +1,11 @@
<?php
use Illuminate\Database\Seeder;
class PostTableSeeder extends Seeder
{
public function run()
{
factory(App\Post::class, 50)->create();
}
}