If $\,f(x)\,$ is a polynomial with integer coefficients and $\,\color{#c00}{f(0) = 1},\ \color{#0a0}{f(-1) = 0}\,$ then the prime $\,p\,$ is the least factor $> 1$ of $\,f((p\!-\!1)!)\, $ since, $\,{\rm mod}\ p\!:\ f((p\!-\!1)!)\equiv \color{#0a0}{f(-1)\equiv 0}\,$ by Wilson, and if prime $\,q< p\,$ then $\,q\mid (p\!-\!1)!\,$ therefore $\,{\rm mod}\ q\!:\ f((p\!-\!1)!) \equiv \color{#c00}{f(0)\equiv 1},\,$ so $\,q\nmid f((p\!-\!1)!).$
OP is special case $\,p=7,\,\ f(x) = (12!/6!\cdot x +1)(x+1),\, $ so $\,f(6!) = (12!+1)(6!+1)$
Above we used standard Congruence Rules, most notably the Polynomial Congruence Rule $\, a\equiv b\,\Rightarrow\, f(a)\equiv f(b)\ \pmod{\! m},\ $ for any polynomial $\,f(x)\,$ with integer coefficients.