Laravel parent/children relationship on it's own model
问题 I want to get all the vouchers that have at least one child, a voucher can have multiple voucher children, but any voucher can only have one parent. I set it up with the following models and calls, and the query it generates is as desired, until this part: 'vouchers'.'parent_id' = 'vouchers'.'id' Wanted functionality: $vouchers = Voucher::has('children')->get(); or $vouchers = Voucher::has('parent')->get(); Resulted Query select * from `vouchers` where `vouchers`.`deleted_at` is null and