refactor: remove photo path columns from attendance schema and simplify validation rules

This commit is contained in:
Yoga Pangestu 2026-06-14 14:53:19 +07:00
parent d076df9d72
commit 46cb2c3588
4 changed files with 6 additions and 10 deletions

View File

@ -18,9 +18,9 @@ public function authorize(): bool
public function rules(): array
{
return [
'photo' => ['required', 'string', 'max:255'],
'latitude' => ['required', 'numeric', 'decimal:0,7', 'between:-90,90'],
'longitude' => ['required', 'numeric', 'decimal:0,7', 'between:-180,180'],
'photo' => ['required', 'string'],
'latitude' => ['required', 'numeric', 'between:-90,90'],
'longitude' => ['required', 'numeric', 'between:-180,180'],
'location_tag' => ['required', 'string', 'max:255'],
];
}

View File

@ -18,9 +18,9 @@ public function authorize(): bool
public function rules(): array
{
return [
'photo' => ['required', 'string', 'max:255'],
'latitude' => ['required', 'numeric', 'decimal:0,7', 'between:-90,90'],
'longitude' => ['required', 'numeric', 'decimal:0,7', 'between:-180,180'],
'photo' => ['required', 'string'],
'latitude' => ['required', 'numeric', 'between:-90,90'],
'longitude' => ['required', 'numeric', 'between:-180,180'],
'location_tag' => ['required', 'string', 'max:255'],
];
}

View File

@ -21,8 +21,6 @@ public function definition(): array
'attendance_date' => $checkInAt->format('Y-m-d'),
'check_in_at' => $checkInAt,
'check_out_at' => $checkOutAt,
'check_in_photo_path' => 'attendance/checkin/'.fake()->uuid().'.jpg',
'check_out_photo_path' => 'attendance/checkout/'.fake()->uuid().'.jpg',
'check_in_latitude' => fake()->latitude(-7, -6),
'check_in_longitude' => fake()->longitude(106, 107),
'check_out_latitude' => fake()->latitude(-7, -6),

View File

@ -16,8 +16,6 @@ public function up(): void
$table->date('attendance_date');
$table->dateTime('check_in_at');
$table->dateTime('check_out_at')->nullable();
$table->string('check_in_photo_path', 255);
$table->string('check_out_photo_path', 255)->nullable();
$table->decimal('check_in_latitude', 10, 7)->nullable();
$table->decimal('check_in_longitude', 10, 7)->nullable();
$table->decimal('check_out_latitude', 10, 7)->nullable();