feat: add SocialAccount model, migration, and factory
Implement SocialAccount model with enum fields for network and type, along with migration and factory. Includes NETWORKS and TYPES constants for dropdown usage in Livewire forms and validation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
889ac9b7f9
commit
137a15f5ff
@@ -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('social_accounts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->enum('network', [
|
||||
'twitter', 'instagram', 'facebook', 'reddit',
|
||||
'tiktok', 'linkedin', 'youtube', 'other',
|
||||
]);
|
||||
$table->string('username');
|
||||
$table->string('email');
|
||||
$table->string('password');
|
||||
$table->enum('type', ['post', 'comment', 'like'])->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('social_accounts');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user