start add Memos
This commit is contained in:
14
database/factories/MemoFactory.php
Normal file
14
database/factories/MemoFactory.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use App\Model;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(\App\Models\Memo::class, function (Faker $faker) {
|
||||
return [
|
||||
'user_id' => factory(\App\User::class),
|
||||
'name' => $faker->words(3, [false]),
|
||||
'memo' => $faker->text($maxNbChars = 200),
|
||||
];
|
||||
});
|
||||
34
database/migrations/2020_03_22_171113_create_memos_table.php
Normal file
34
database/migrations/2020_03_22_171113_create_memos_table.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMemosTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('memos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->string('name');
|
||||
$table->longText('memo');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('memos');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user