mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-13 23:56:47 +00:00
🛠️ Add services index and landing page components with dynamic links and new Polish translations
This commit is contained in:
34
database/factories/SelfHostedServiceFactory.php
Normal file
34
database/factories/SelfHostedServiceFactory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\SelfHostedServiceType;
|
||||
use App\Models\SelfHostedService;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<SelfHostedService>
|
||||
*/
|
||||
class SelfHostedServiceFactory extends Factory
|
||||
{
|
||||
protected $model = SelfHostedService::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$name = $this->faker->unique()->company();
|
||||
|
||||
return [
|
||||
'created_by' => User::factory(),
|
||||
'name' => $name,
|
||||
'slug' => str($name)->slug(),
|
||||
'intro' => $this->faker->optional()->paragraph(),
|
||||
'url_clearnet' => $this->faker->optional()->url(),
|
||||
'url_onion' => null,
|
||||
'url_i2p' => null,
|
||||
'url_pkdns' => null,
|
||||
'type' => $this->faker->randomElement(SelfHostedServiceType::cases())->value,
|
||||
'contact_url' => $this->faker->optional()->url(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('self_hosted_services', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();
|
||||
$table->text('intro')->nullable();
|
||||
$table->string('url_clearnet')->nullable();
|
||||
$table->string('url_onion')->nullable();
|
||||
$table->string('url_i2p')->nullable();
|
||||
$table->string('url_pkdns')->nullable();
|
||||
$table->string('type');
|
||||
$table->text('contact')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('created_by');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('self_hosted_services');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user