How can I add a join to a custom exists rule for a laravel validator?
问题 The validator in laravel can have a customization of the exists database rule, for instance if you need to check an extra column. An example from the manual: use Illuminate\Validation\Rule; Validator::make($data, [ 'email' => [ 'required', Rule::exists('staff')->where(function ($query) { $query->where('account_id', 1); }), ], ]); The query in the closure is not typehinted, so i'm not quite positive what kind of object this is. I can see that the DatabaseRule itself only has some function