first commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
*.sqlite*
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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('proxies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('proxy');
|
||||
$table->string('protocol');
|
||||
$table->string('ip');
|
||||
$table->integer('port');
|
||||
$table->boolean('https');
|
||||
$table->string('anonymity');
|
||||
$table->integer('score');
|
||||
$table->string('country')->nullable();
|
||||
$table->string('city')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('proxies');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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('proxies_list', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('url');
|
||||
$table->string('scrape_type');
|
||||
$table->string('proxy_type');
|
||||
$table->timestamp('last_scraped_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('proxies_list');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
|
||||
$this->call([
|
||||
ProxiesListSeeder::class
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\ProxiesList;
|
||||
|
||||
class ProxiesListSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// HTTP/HTTPS proxies with new_line scrape type
|
||||
$httpUrls = [
|
||||
'https://openproxy.space/list/http',
|
||||
'https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&protocol=http&proxy_format=ipport&format=text&timeout=20000',
|
||||
'https://proxyspace.pro/http.txt',
|
||||
'https://rootjazz.com/proxies/proxies.txt',
|
||||
'https://spys.me/proxy.txt',
|
||||
'https://proxyhub.me/en/all-http-proxy-list.html',
|
||||
'https://proxy-tools.com/proxy/http',
|
||||
'https://www.proxy-list.download/api/v1/get?type=http',
|
||||
'https://www.proxynova.com/proxy-server-list/',
|
||||
'https://cdn.rei.my.id/proxy/HTTP',
|
||||
'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/http.txt',
|
||||
'https://raw.githubusercontent.com/zevtyardt/proxy-list/main/http.txt',
|
||||
'https://raw.githubusercontent.com/ALIILAPRO/Proxy/main/http.txt',
|
||||
'https://raw.githubusercontent.com/Zaeem20/FREE_PROXIES_LIST/master/http.txt',
|
||||
'https://raw.githubusercontent.com/Zaeem20/FREE_PROXIES_LIST/master/https.txt',
|
||||
'https://raw.githubusercontent.com/vakhov/fresh-proxy-list/master/http.txt',
|
||||
'https://raw.githubusercontent.com/vakhov/fresh-proxy-list/master/https.txt',
|
||||
'https://raw.githubusercontent.com/aslisk/proxyhttps/master/https.txt',
|
||||
'https://raw.githubusercontent.com/hendrikbgr/Free-Proxy-Repo/master/proxy_list.txt',
|
||||
'https://raw.githubusercontent.com/mmpx12/proxy-list/master/https.txt',
|
||||
'https://raw.githubusercontent.com/mmpx12/proxy-list/master/http.txt',
|
||||
'https://raw.githubusercontent.com/roosterkid/openproxylist/master/HTTPS_RAW.txt',
|
||||
'https://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/https.txt',
|
||||
'https://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/http.txt',
|
||||
'https://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/http.txt',
|
||||
'https://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/https.txt'
|
||||
];
|
||||
|
||||
// SOCKS4 proxies with new_line scrape type
|
||||
$socks4Urls = [
|
||||
'https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&protocol=socks4&proxy_format=ipport&format=text&timeout=20000',
|
||||
'https://proxyspace.pro/socks4.txt',
|
||||
'https://www.proxy-list.download/api/v1/get?type=socks4',
|
||||
'https://cdn.rei.my.id/proxy/SOCKS4',
|
||||
'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks4.txt',
|
||||
'https://raw.githubusercontent.com/zevtyardt/proxy-list/main/socks4.txt',
|
||||
'https://raw.githubusercontent.com/ALIILAPRO/Proxy/main/socks4.txt',
|
||||
'https://raw.githubusercontent.com/Zaeem20/FREE_PROXIES_LIST/master/socks4.txt',
|
||||
'https://raw.githubusercontent.com/noarche/proxylist-socks5-sock4-exported-updates/main/socks4-online.txt',
|
||||
'https://raw.githubusercontent.com/vakhov/fresh-proxy-list/master/socks4.txt',
|
||||
'https://raw.githubusercontent.com/mmpx12/proxy-list/master/socks4.txt',
|
||||
'https://raw.githubusercontent.com/roosterkid/openproxylist/master/SOCKS4_RAW.txt',
|
||||
'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/socks4.txt',
|
||||
'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt',
|
||||
'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/httpS.txt',
|
||||
'https://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/socks4.txt',
|
||||
'https://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/socks4.txt'
|
||||
];
|
||||
|
||||
// SOCKS4 proxies with scrape_website scrape type
|
||||
$socks4WebUrls = [
|
||||
'https://proxyhub.me/en/all-socks4-proxy-list.html',
|
||||
'https://www.my-proxy.com/free-socks-4-proxy.html',
|
||||
'https://www.socks-proxy.net/'
|
||||
];
|
||||
|
||||
// SOCKS5 proxies with new_line scrape type
|
||||
$socks5Urls = [
|
||||
'https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&protocol=socks5&proxy_format=ipport&format=text&timeout=20000',
|
||||
'https://proxyspace.pro/socks5.txt',
|
||||
'https://www.proxy-list.download/api/v1/get?type=socks5',
|
||||
'https://raw.githubusercontent.com/hookzof/socks5_list/master/proxy.txt',
|
||||
'https://raw.githubusercontent.com/monosans/proxy-list/main/proxies/socks5.txt',
|
||||
'https://raw.githubusercontent.com/zevtyardt/proxy-list/main/socks5.txt',
|
||||
'https://raw.githubusercontent.com/ALIILAPRO/Proxy/main/socks5.txt',
|
||||
'https://raw.githubusercontent.com/Zaeem20/FREE_PROXIES_LIST/master/socks5.txt',
|
||||
'https://raw.githubusercontent.com/noarche/proxylist-socks5-sock4-exported-updates/main/socks5-online.txt',
|
||||
'https://raw.githubusercontent.com/vakhov/fresh-proxy-list/master/socks5.txt',
|
||||
'https://raw.githubusercontent.com/mmpx12/proxy-list/master/socks5.txt',
|
||||
'https://raw.githubusercontent.com/roosterkid/openproxylist/master/SOCKS5_RAW.txt',
|
||||
'https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/socks5.txt',
|
||||
'https://raw.githubusercontent.com/ErcinDedeoglu/proxies/main/proxies/socks5.txt',
|
||||
'https://raw.githubusercontent.com/Tsprnay/Proxy-lists/master/proxies/socks5.txt'
|
||||
];
|
||||
|
||||
// SOCKS5 proxies with scrape_website scrape type
|
||||
$socks5WebUrls = [
|
||||
'https://proxy-tools.com/proxy/socks5',
|
||||
'https://proxyhub.me/en/all-sock5-proxy-list.html'
|
||||
];
|
||||
|
||||
// Insert HTTP/HTTPS proxies
|
||||
foreach ($httpUrls as $url) {
|
||||
ProxiesList::create([
|
||||
'url' => $url,
|
||||
'scrape_type' => 'new_line',
|
||||
'proxy_type' => 'http'
|
||||
]);
|
||||
}
|
||||
|
||||
// Insert SOCKS4 proxies with new_line scrape type
|
||||
foreach ($socks4Urls as $url) {
|
||||
ProxiesList::create([
|
||||
'url' => $url,
|
||||
'scrape_type' => 'new_line',
|
||||
'proxy_type' => 'socks4'
|
||||
]);
|
||||
}
|
||||
|
||||
// Insert SOCKS4 proxies with scrape_website scrape type
|
||||
foreach ($socks4WebUrls as $url) {
|
||||
ProxiesList::create([
|
||||
'url' => $url,
|
||||
'scrape_type' => 'scrape_website',
|
||||
'proxy_type' => 'socks4'
|
||||
]);
|
||||
}
|
||||
|
||||
// Insert SOCKS5 proxies with new_line scrape type
|
||||
foreach ($socks5Urls as $url) {
|
||||
ProxiesList::create([
|
||||
'url' => $url,
|
||||
'scrape_type' => 'new_line',
|
||||
'proxy_type' => 'socks5'
|
||||
]);
|
||||
}
|
||||
|
||||
// Insert SOCKS5 proxies with scrape_website scrape type
|
||||
foreach ($socks5WebUrls as $url) {
|
||||
ProxiesList::create([
|
||||
'url' => $url,
|
||||
'scrape_type' => 'scrape_website',
|
||||
'proxy_type' => 'socks5'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user