소스 검색

Add CircleProfile controller, model and migration

Daniel Supernault 6 년 전
부모
커밋
ee4b7ba8b2
3개의 변경된 파일58개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      app/CircleProfile.php
  2. 10 0
      app/Http/Controllers/CircleProfileController.php
  3. 35 0
      database/migrations/2019_02_09_045956_create_circle_profiles_table.php

+ 13 - 0
app/CircleProfile.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class CircleProfile extends Model
+{
+    protected $fillable = [
+    	'circle_id',
+    	'profile_id'
+    ];
+}

+ 10 - 0
app/Http/Controllers/CircleProfileController.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+
+class CircleProfileController extends Controller
+{
+    //
+}

+ 35 - 0
database/migrations/2019_02_09_045956_create_circle_profiles_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCircleProfilesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('circle_profiles', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->bigInteger('owner_id')->unsigned()->nullable()->index();
+            $table->bigInteger('circle_id')->unsigned()->index();
+            $table->bigInteger('profile_id')->unsigned()->index();
+            $table->unique(['circle_id', 'profile_id']);
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('circle_profiles');
+    }
+}