Implement dark mode, bug report page, and schema dump
This commit is contained in:
43
database/factories/BudgetFactory.php
Normal file
43
database/factories/BudgetFactory.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Budget;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class BudgetFactory extends Factory
|
||||
{
|
||||
protected $model = Budget::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$start = now()->startOfYear();
|
||||
|
||||
return [
|
||||
'fiscal_year' => now()->year,
|
||||
'name' => $this->faker->sentence(3),
|
||||
'period_type' => 'annual',
|
||||
'period_start' => $start,
|
||||
'period_end' => $start->copy()->endOfYear(),
|
||||
'status' => Budget::STATUS_DRAFT,
|
||||
'created_by_user_id' => User::factory(),
|
||||
'approved_by_user_id' => null,
|
||||
'approved_at' => null,
|
||||
'notes' => $this->faker->sentence(),
|
||||
];
|
||||
}
|
||||
|
||||
public function submitted(): static
|
||||
{
|
||||
return $this->state(fn () => ['status' => Budget::STATUS_SUBMITTED]);
|
||||
}
|
||||
|
||||
public function approved(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'status' => Budget::STATUS_APPROVED,
|
||||
'approved_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user