Basic routes and BeerListController methods

This commit is contained in:
2021-09-04 23:54:41 +02:00
parent 1b8e76b183
commit 26dbfeb94a
20 changed files with 146 additions and 64 deletions

View File

@@ -14,7 +14,8 @@ class CreateBeerListsTable extends Migration
public function up()
{
Schema::create('beer_lists', function (Blueprint $table) {
$table->unsignedBigInteger('id');
$table->id();
$table->string('title')->nullable();
$table->integer('user_id');
$table->timestamps();
});

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ListBeersPivotTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('list_beers_pivot', function (Blueprint $table) {
$table->unsignedBigInteger('id');
$table->unsignedBigInteger('beer_id');
$table->unsignedBigInteger('list_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('list_beers_pivot');
}
}