Add (initial): futurewalker code

This commit is contained in:
2023-11-20 00:15:18 +08:00
parent f8602cb456
commit 9ce3e5c82a
166 changed files with 15941 additions and 1072 deletions

View File

@@ -14,13 +14,19 @@ public function up(): void
Schema::create('serp_urls', function (Blueprint $table) {
$table->id();
$table->foreignId('news_serp_result_id');
$table->foreignId('category_id');
$table->string('category_name');
$table->foreignId('category_id')->nullable();
$table->string('category_name')->nullable();
$table->string('source')->default('serp');
$table->string('url');
$table->string('country_iso');
$table->string('title')->nullable();
$table->text('description')->nullable();
$table->boolean('picked')->default(false);
$table->boolean('processed')->default(false);
$table->boolean('crawled')->default(false);
$table->boolean('written')->default(false);
$table->json('suggestion_data')->nullable();
$table->datetime('url_posted_at');
$table->timestamp('serp_at')->nullable();
$table->enum('status', ['initial', 'processing', 'complete', 'failed', 'blocked', 'limited'])->default('initial');
$table->tinyInteger('process_status')->nullable();

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('serp_url_researches', function (Blueprint $table) {
$table->id();
$table->foreignId('serp_url_id');
$table->string('url');
$table->string('query');
$table->text('content')->nullable();
$table->mediumText('main_image')->nullable();
$table->timestamps();
$table->foreign('serp_url_id')->references('id')->on('serp_urls');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('serp_url_researches');
}
};

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('service_cost_usages', function (Blueprint $table) {
$table->id();
$table->double('cost', 5, 5);
$table->string('name');
$table->string('reference_1')->nullable();
$table->string('reference_2')->nullable();
$table->jsonb('output');
$table->text('input_1')->nullable();
$table->text('input_2')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('service_cost_usages');
}
};

View File

@@ -13,23 +13,25 @@ public function up(): void
{
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->foreignId('serp_url_id')->nullable();
$table->string('title')->nullable();
$table->string('short_title')->nullable();
$table->string('slug')->nullable();
$table->string('type')->nullable();
$table->string('main_keyword')->nullable();
$table->json('keywords')->nullable();
$table->mediumText('excerpt')->nullable();
$table->mediumText('bites')->nullable();
$table->mediumText('society_impact')->nullable();
$table->enum('society_impact_level', ['low','medium','high'])->default('low');
$table->foreignId('author_id')->nullable();
$table->boolean('featured')->default(false);
$table->string('featured_image')->nullable();
$table->mediumText('featured_image')->nullable();
$table->text('body')->nullable();
$table->json('metadata')->nullable();
$table->integer('views_count')->default(0);
$table->enum('status', ['publish', 'future', 'draft', 'private', 'trash'])->default('draft');
$table->timestamp('published_at')->nullable();
$table->timestamps();
$table->foreign('author_id')->references('id')->on('authors');
$table->foreign('serp_url_id')->references('id')->on('serp_urls');
});
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('entities', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug');
$table->mediumText('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('entities');
}
};

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('post_entities', function (Blueprint $table) {
$table->id();
$table->foreignId('post_id');
$table->foreignId('entity_id');
$table->timestamps();
$table->foreign('post_id')->references('id')->on('posts');
$table->foreign('entity_id')->references('id')->on('entities');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('post_entities');
}
};

View File

@@ -13,7 +13,7 @@ class AuthorSeeder extends Seeder
public function run(): void
{
Author::create([
'name' => 'EchoScoop Team',
'name' => 'FutureWalker Team',
'bio' => null,
'avatar' => null,
'enabled' => true, // Assuming you want this author to be enabled by default

View File

@@ -13,92 +13,12 @@ class CategorySeeder extends Seeder
public function run(): void
{
$categories = [
['name' => 'Automotive', 'short_name' => 'Automotive'],
[
'name' => 'Business',
'short_name' => 'Business',
'children' => [
['name' => 'Trading', 'short_name' => 'Trading'],
['name' => 'Information Technology', 'short_name' => 'IT'],
['name' => 'Marketing', 'short_name' => 'Marketing'],
['name' => 'Office', 'short_name' => 'Office'],
['name' => 'Telecommunications', 'short_name' => 'Telecom'],
],
],
['name' => 'Food & Drink', 'short_name' => 'Food'],
[
'name' => 'Hobbies & Gifts',
'short_name' => 'Hobbies',
'children' => [
['name' => 'Collectibles', 'short_name' => 'Collectibles'],
['name' => 'Pets', 'short_name' => 'Pets'],
['name' => 'Photography', 'short_name' => 'Photography'],
['name' => 'Hunting & Fishing', 'short_name' => 'Hunting'],
],
],
['name' => 'Law', 'short_name' => 'Law'],
['name' => 'Politics', 'short_name' => 'Politics'],
[
'name' => 'Shopping',
'short_name' => 'Shopping',
'children' => [
['name' => 'Home & Garden', 'short_name' => 'Home'],
['name' => 'Fashion & Clothing', 'short_name' => 'Fashion'],
],
],
['name' => 'Real Estate', 'short_name' => 'Real Estate'],
[
'name' => 'Society',
'short_name' => 'Society',
'children' => [
['name' => 'Family', 'short_name' => 'Family'],
['name' => 'Wedding', 'short_name' => 'Wedding'],
['name' => 'Immigration', 'short_name' => 'Immigration'],
[
'name' => 'Education',
'short_name' => 'Education',
'children' => [
['name' => 'Languages', 'short_name' => 'Languages'],
],
],
],
],
[
'name' => 'Wellness',
'short_name' => 'Wellness',
'children' => [
['name' => 'Health', 'short_name' => 'Health'],
['name' => 'Beauty', 'short_name' => 'Beauty'],
['name' => 'Psychology', 'short_name' => 'Psychology'],
['name' => 'Religion & Spirituality', 'short_name' => 'Religion'],
],
],
[
'name' => 'Tips & Tricks',
'short_name' => 'Tips',
'children' => [
['name' => 'How to', 'short_name' => 'How to'],
],
],
[
'name' => 'Travel',
'short_name' => 'Travel',
'children' => [
['name' => 'Holiday', 'short_name' => 'Holiday'],
['name' => 'World Festivals', 'short_name' => 'Festivals'],
['name' => 'Outdoors', 'short_name' => 'Outdoors'],
],
],
[
'name' => 'Technology',
'short_name' => 'Tech',
'children' => [
['name' => 'Computer', 'short_name' => 'Computer'],
['name' => 'Phones', 'short_name' => 'Phones'],
['name' => 'Gadgets', 'short_name' => 'Gadgets'],
['name' => 'Social Networks', 'short_name' => 'Social Networks'],
],
],
['name' => 'Updates', 'short_name' => 'Updates'],
['name' => 'Opinions', 'short_name' => 'Opinions'],
['name' => 'Features', 'short_name' => 'Features'],
['name' => 'New Launches', 'short_name' => 'New Launches'],
['name' => 'How Tos', 'short_name' => 'How Tos'],
['name' => 'Reviews', 'short_name' => 'Reviews'],
];
foreach ($categories as $category) {