Last active
September 7, 2017 01:20
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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