schema = $schema; $this->table = $table; $this->column = $column; } public function passes($attribute, $value) { // Check if a record exists with the given value in the specified schema, table, and column. $query = DB::table($this->schema . '.' . $this->table) ->where($this->column, $value); return $query->exists(); } public function message() { return 'The selected :attribute is invalid.'; } public function validate(string $attribute, mixed $value, Closure $fail): void { if (!$this->passes($attribute, $value)) { $fail($this->message()); } } }