add seeder for post & routing for list of post

This commit is contained in:
jenoh
2020-03-13 16:15:48 +01:00
parent 9f7ebbc3d0
commit 092e42e197
7 changed files with 123 additions and 2 deletions

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title', 100)->unique();
$table->string('content', 2000);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
}