committing because I'm paranoid
parent
811cb953a3
commit
b6890ce2c2
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateForumsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('forums', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('forums');
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class TagThread extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create("tag_thread", function(Blueprint $table) {
|
||||
//Columns
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('tag_id');
|
||||
$table->foreign('tag_id')
|
||||
->references('id')
|
||||
->on('tags')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->unsignedBigInteger('thread_id');
|
||||
$table->foreign('thread_id')
|
||||
->references('id')
|
||||
->on('threads')
|
||||
->onDelete('cascade');
|
||||
|
||||
//Key constraints
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tag_thread');
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PostsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ThreadsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$titles = array([
|
||||
"WHY ARE THERE SO MANY ASSASSIN'S CREED GAMES", "This new Yoshi game is awesome!", "I am better at Fortnite than all my friends I am 12",
|
||||
"This new Yoshi game is awesome!", "OMG!!! Bowser took over Nintendo!", "Grant Kirkhope the best video game composer ever?",
|
||||
"The coolest Devil May Cry V autocombos", "Sekiro should respect it's playerbase and add an easy mode", "Is everyone who plays Fortnite 12 years old?"
|
||||
]);
|
||||
|
||||
for($i = 0; $i<9; $i++) {
|
||||
DB::table('threads')->insert([
|
||||
'thread_title' => $titles[$i],
|
||||
'thread_creator_id' => $i+2
|
||||
]);
|
||||
}
|
||||
|
||||
DB::table('threads')->insert([
|
||||
'thread_title' => "Welcome to GameGab!",
|
||||
'thread_creator_id' => 1
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UsersTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('users')->insert([
|
||||
'name' => 'GameGabTeam',
|
||||
'email' => Str::random(10).'@gmail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
]);
|
||||
|
||||
for($i=0; $i<10; $i++) {
|
||||
DB::table('users')->insert([
|
||||
'name' => Str::random(10),
|
||||
'email' => Str::random(10).'@gmail.com',
|
||||
'password' => bcrypt('secret'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<div v-if="loginStart" class=""
|
||||
</div>
|
||||
</template>
|
@ -0,0 +1,33 @@
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
threads: [],
|
||||
thread: {
|
||||
id: '',
|
||||
title: '',
|
||||
creator: ''
|
||||
},
|
||||
thread_id: '',
|
||||
pagination: {},
|
||||
edit: false
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.fetchThreads();
|
||||
},
|
||||
|
||||
methods: {
|
||||
fetchThreads() {
|
||||
fetch("api/threads")
|
||||
.then(res => json())
|
||||
.then(res => {
|
||||
console.log(res.data);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue