mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-21 22:11:26 +00:00
Add CircleProfile controller, model and migration
This commit is contained in:
parent
e00f65da03
commit
ee4b7ba8b2
3 changed files with 58 additions and 0 deletions
13
app/CircleProfile.php
Normal file
13
app/CircleProfile.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CircleProfile extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'circle_id',
|
||||
'profile_id'
|
||||
];
|
||||
}
|
10
app/Http/Controllers/CircleProfileController.php
Normal file
10
app/Http/Controllers/CircleProfileController.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CircleProfileController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue