Installer

This commit is contained in:
2021-07-28 01:33:22 +02:00
parent bef4bc2198
commit 37b600195c
10 changed files with 272 additions and 22 deletions
+25
View File
@@ -0,0 +1,25 @@
title = "SubTest"
layout = "default"
url = "/subtest"
==
<?php
function RandomString($len = 10) {
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randstring = '';
for ($i = 0; $i < $len; $i++) {
$randstring .= $characters[rand(0, strlen($characters) - 1)];
}
return $randstring;
}
function onStart() {
$ac = new GermanAirlinesVa\Fleet\Models\Aircraft();
$ac->aircraft_type_id = 1;
$ac->home_airport_id = 1;
$ac->registration = "D-".$this->RandomString(4);
$ac->name = $this->RandomString();
$ac->save();
\Nuwave\Lighthouse\Execution\Utils\Subscription::broadcast('aircraft', $ac);
}
?>
==