diff options
-rw-r--r-- | app/Models/Post.php | 11 | ||||
-rw-r--r-- | app/Models/Reservation.php | 11 | ||||
-rw-r--r-- | database/migrations/2020_10_18_142620_create_posts_table.php | 33 | ||||
-rw-r--r-- | database/migrations/2020_10_18_142649_create_reservations_table.php | 32 |
4 files changed, 87 insertions, 0 deletions
diff --git a/app/Models/Post.php b/app/Models/Post.php new file mode 100644 index 0000000..089656b --- /dev/null +++ b/app/Models/Post.php @@ -0,0 +1,11 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; + +class Post extends Model +{ + use HasFactory; +} diff --git a/app/Models/Reservation.php b/app/Models/Reservation.php new file mode 100644 index 0000000..021f3d6 --- /dev/null +++ b/app/Models/Reservation.php @@ -0,0 +1,11 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; + +class Reservation extends Model +{ + use HasFactory; +} diff --git a/database/migrations/2020_10_18_142620_create_posts_table.php b/database/migrations/2020_10_18_142620_create_posts_table.php new file mode 100644 index 0000000..923295d --- /dev/null +++ b/database/migrations/2020_10_18_142620_create_posts_table.php @@ -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->id(); + $table->string('author', 255)->nullable(); + $table->longText('text'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('posts'); + } +} diff --git a/database/migrations/2020_10_18_142649_create_reservations_table.php b/database/migrations/2020_10_18_142649_create_reservations_table.php new file mode 100644 index 0000000..fc8e39a --- /dev/null +++ b/database/migrations/2020_10_18_142649_create_reservations_table.php @@ -0,0 +1,32 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateReservationsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('reservations', function (Blueprint $table) { + $table->id(); + $table->boolean('approved')->default(false); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('reservations'); + } +} |