Installer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
?>
|
||||
==
|
||||
Reference in New Issue
Block a user