Laravel alt yapısı ile tek bir kayıt formu kullanarak birden fazla tabloya kayıt gerçekleştirmek gerekebilir.
Bu durumda kullanılan örnek kod aşağıdaki gibidir;
public function store(Request $request) {
//detail tablosuna veri yazıyoruz
$detail = new detail();
$detail->name = $request->input("name");
$detail->age = $request->input("age");
$detail->save();
//location tablosuna veri yazıyoruz
$location = new location();
$location->detail_id = $detail->id; $
location->location = $request->input("location");
$location->save();
}