Skip to content

Instantly share code, notes, and snippets.

@developerdino
Last active September 7, 2017 01:20
Show Gist options
  • Save developerdino/b45613b1d2daa4877592ce4eef77f2cc to your computer and use it in GitHub Desktop.
Save developerdino/b45613b1d2daa4877592ce4eef77f2cc to your computer and use it in GitHub Desktop.
Using Laravel 5.5 Resources to create your own {JSON:API} formatted API - Medium Gists
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePeopleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('people', function (Blueprint $table) {
$table->increments('id');
$table->string('first_name');
$table->string('last_name');
$table->string('twitter');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('people');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment