Add DiscoverCategoryHashtag model

This commit is contained in:
Daniel Supernault 2019-02-07 00:35:38 -07:00
parent 32d1667311
commit 40ffaee6ed
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
3 changed files with 57 additions and 0 deletions

View File

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

View File

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

View File

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