mad-lawsuit/database/seeders/DocketSeeder.php
TheMaddax 06a620406c Phase 1: Email subscription and document download features
- Created SubscriptionController with subscribe/unsubscribe endpoints
- Added subscription API routes (POST /api/subscribe, GET /api/unsubscribe/{token})
- Updated Vue Home component with working subscription form
- Created DocumentController with download endpoint
- Added document download route (GET /api/documents/{id}/download)
- Updated Vue component to link PDF buttons to download route
- Created DocketSeeder with 5 sample docket entries and documents
- Seeded database with test data for development

Features working:
- Email subscription with validation and duplicate checking
- Subscription reactivation for previously unsubscribed emails
- Document download functionality (ready for actual PDFs)
- Sample data for testing UI

Next: Admin dashboard for CRUD operations
2025-12-17 15:51:47 -07:00

122 lines
5.2 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\DocketEntry;
use App\Models\Document;
use Illuminate\Database\Seeder;
class DocketSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// Sample docket entries with documents
$entries = [
[
'date' => '2024-01-15',
'title' => 'Complaint Filed',
'summary' => 'Elizabeth Kragh filed a complaint against Montana Association of the Deaf alleging discrimination and wrongful termination. The complaint outlines multiple instances of workplace discrimination and seeks damages.',
'notes' => 'Initial filing',
'documents' => [
[
'title' => 'Original Complaint',
'original_filename' => 'complaint.pdf',
'stored_filename' => 'complaint_001.pdf',
'file_path' => 'documents/complaint_001.pdf',
'file_size' => 245678,
'mime_type' => 'application/pdf',
'summary' => 'Initial complaint document',
'display_order' => 1,
],
],
],
[
'date' => '2024-02-01',
'title' => 'Answer to Complaint',
'summary' => 'Montana Association of the Deaf filed their answer to the complaint, denying all allegations and asserting various affirmative defenses.',
'notes' => 'Defendant response',
'documents' => [
[
'title' => 'Answer to Complaint',
'original_filename' => 'answer.pdf',
'stored_filename' => 'answer_001.pdf',
'file_path' => 'documents/answer_001.pdf',
'file_size' => 189234,
'mime_type' => 'application/pdf',
'summary' => 'Defendant answer',
'display_order' => 1,
],
],
],
[
'date' => '2024-03-10',
'title' => 'Motion for Summary Judgment',
'summary' => 'Plaintiff filed a motion for summary judgment on certain claims, arguing that there are no genuine issues of material fact and that judgment should be entered as a matter of law.',
'notes' => 'Key motion',
'documents' => [
[
'title' => 'Motion for Summary Judgment',
'original_filename' => 'motion_summary_judgment.pdf',
'stored_filename' => 'motion_001.pdf',
'file_path' => 'documents/motion_001.pdf',
'file_size' => 312456,
'mime_type' => 'application/pdf',
'summary' => 'Summary judgment motion',
'display_order' => 1,
],
[
'title' => 'Supporting Brief',
'original_filename' => 'supporting_brief.pdf',
'stored_filename' => 'brief_001.pdf',
'file_path' => 'documents/brief_001.pdf',
'file_size' => 456789,
'mime_type' => 'application/pdf',
'summary' => 'Brief in support of motion',
'display_order' => 2,
],
],
],
[
'date' => '2024-04-05',
'title' => 'Discovery Order',
'summary' => 'Court issued an order regarding discovery disputes, setting deadlines for document production and depositions.',
'notes' => 'Discovery schedule',
'documents' => [],
],
[
'date' => '2024-05-20',
'title' => 'Expert Witness Disclosure',
'summary' => 'Plaintiff disclosed expert witnesses who will testify regarding workplace discrimination and damages calculations.',
'notes' => 'Expert disclosures',
'documents' => [
[
'title' => 'Expert Report - Dr. Smith',
'original_filename' => 'expert_report_smith.pdf',
'stored_filename' => 'expert_001.pdf',
'file_path' => 'documents/expert_001.pdf',
'file_size' => 567890,
'mime_type' => 'application/pdf',
'summary' => 'Expert testimony on discrimination',
'display_order' => 1,
],
],
],
];
foreach ($entries as $entryData) {
$documents = $entryData['documents'] ?? [];
unset($entryData['documents']);
$entry = DocketEntry::create($entryData);
foreach ($documents as $docData) {
$entry->documents()->create($docData);
}
}
$this->command->info('Created ' . count($entries) . ' docket entries with sample documents.');
}
}