. */ namespace Database\Factories; use Illuminate\Support\Str; use Illuminate\Database\Eloquent\Factories\Factory; use Awobaz\Compoships\Database\Eloquent\Factories\ComposhipsFactory; use App\Account; use App\Http\Controllers\Account\AuthenticateController as WebAuthenticateController; class AccountFactory extends Factory { use ComposhipsFactory; protected $model = Account::class; public function definition() { return [ 'username' => $this->faker->username, 'display_name' => $this->faker->name, 'domain' => config('app.sip_domain'), 'email' => $this->faker->email, 'user_agent' => $this->faker->userAgent, 'confirmation_key' => Str::random(WebAuthenticateController::$emailCodeSize), 'ip_address' => $this->faker->ipv4, 'created_at' => $this->faker->dateTimeBetween('-1 year'), 'dtmf_protocol' => array_rand(Account::$dtmfProtocols), 'activated' => true, 'admin' => false ]; } public function admin() { return $this->state(fn (array $attributes) => [ 'admin' => true, ]); } }