Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@plcosta
Created March 3, 2016 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plcosta/d3586ed721b6022906a7 to your computer and use it in GitHub Desktop.
Save plcosta/d3586ed721b6022906a7 to your computer and use it in GitHub Desktop.
Lumen bug?
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Bed extends Model
{
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Bed;
class BedsController extends Controller
{
public function index()
{
$beds = Bed::all();
return response()->json($beds);
}
}
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBedsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('beds', function (Blueprint $table) {
$table->increments('id');
$table->integer('bed_id');
$table->integer('status_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('beds');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment