refactor: remove photo path columns from attendance schema and simplify validation rules
This commit is contained in:
parent
d076df9d72
commit
46cb2c3588
@ -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'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -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'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user