mirror of
https://github.com/Aviortheking/CA_LARAVEL.git
synced 2025-06-16 03:19:19 +00:00
add seeder for post & routing for list of post
This commit is contained in:
33
database/migrations/2020_03_13_101425_create_posts_table.php
Normal file
33
database/migrations/2020_03_13_101425_create_posts_table.php
Normal 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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user