Per this link, https://laravel.com/docs/5.4/database-testing#writing-factories, the default Laravel user factory tests the value of a static $password
variable. If it is falsey, it bcrypts 'secret' and uses that.
How does one go about setting the value of the static variable $password
? Obviously I don't want to import it at the time the function is declared (since that would defeat the purpose of making it variable). I realise that I can override the value of password by passing an array to the make()
method, but this is a different thing altogether.