id(); $table->foreignId('sales_route_id')->constrained()->cascadeOnDelete(); $table->enum('type', ['checkin', 'checkout', 'gps', 'lunch', 'visit']); $table->decimal('latitude', 10, 8); $table->decimal('longitude', 11, 8); $table->timestamp('recorded_at'); $table->string('location_name', 200)->nullable(); $table->text('address')->nullable(); $table->text('notes')->nullable(); $table->string('photo_url', 500)->nullable(); $table->timestamps(); $table->index(['sales_route_id', 'recorded_at']); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('waypoints'); } };