Create Budget model and its migration
ADD
app/Models/Budget.php
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+class Budget extends Model
+{
+ use SoftDeletes;
+
+ public function space()
+ {
+ return $this->belongsTo(Space::class);
+ }
+
+ public function tag()
+ {
+ return $this->belongsTo(Tag::class);
+ }
+}

ADD
database/migrations/2020_07_01_181201_create_budgets_table.php
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateBudgetsTable extends Migration
+{
+ public function up(): void
+ {
+ Schema::create('budgets', function (Blueprint $table) {
+ $table->id();
+ $table->unsignedInteger('space_id');
+ $table->unsignedInteger('tag_id');
+ $table->string('period');
+ $table->unsignedInteger('amount');
+ $table->date('starts_on');
+ $table->date('ends_on')->nullable();
+ $table->timestamps();
+ $table->softDeletes();
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::dropIfExists('budgets');
+ }
+}

Create Budget model and its migration