Laravel 9 Update (#1413)
Update to Laravel 9 and PHP 8+ Co-authored-by: B.Fatih KOZ <fatih.koz@gmail.com>
This commit is contained in:
@@ -1,23 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Acars::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'pirep_id' => null,
|
||||
'log' => $faker->text(100),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'heading' => $faker->numberBetween(0, 359),
|
||||
'altitude' => $faker->numberBetween(20, 400),
|
||||
'vs' => $faker->numberBetween(-5000, 5000),
|
||||
'gs' => $faker->numberBetween(300, 500),
|
||||
'transponder' => $faker->numberBetween(200, 9999),
|
||||
'autopilot' => $faker->text(10),
|
||||
'fuel' => $faker->randomFloat(2, 100, 1000),
|
||||
'fuel_flow' => $faker->randomFloat(2, 100, 1000),
|
||||
'sim_time' => $faker->dateTime('now', 'UTC'),
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Acars;
|
||||
use DateTime;
|
||||
|
||||
class AcarsFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Acars::class;
|
||||
|
||||
/**
|
||||
* @return array <string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'pirep_id' => null,
|
||||
'log' => $this->faker->text(100),
|
||||
'lat' => $this->faker->latitude,
|
||||
'lon' => $this->faker->longitude,
|
||||
'distance' => $this->faker->randomFloat(2, 0, 6000),
|
||||
'heading' => $this->faker->numberBetween(0, 359),
|
||||
'altitude' => $this->faker->numberBetween(20, 400),
|
||||
'vs' => $this->faker->numberBetween(-5000, 5000),
|
||||
'gs' => $this->faker->numberBetween(300, 500),
|
||||
'transponder' => $this->faker->numberBetween(200, 9999),
|
||||
'autopilot' => $this->faker->text(10),
|
||||
'fuel' => $this->faker->randomFloat(2, 100, 1000),
|
||||
'fuel_flow' => $this->faker->randomFloat(2, 100, 1000),
|
||||
'sim_time' => $this->faker->dateTime('now', 'UTC')->format(DateTime::ATOM),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,51 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Aircraft;
|
||||
use App\Models\Airport;
|
||||
use App\Models\Enums\AircraftState;
|
||||
use App\Models\Enums\AircraftStatus;
|
||||
use App\Models\Subfleet;
|
||||
use App\Support\ICAO;
|
||||
use Faker\Generator as Faker;
|
||||
use DateTime;
|
||||
|
||||
$factory->define(App\Models\Aircraft::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'subfleet_id' => function () {
|
||||
return factory(Subfleet::class)->create()->id;
|
||||
},
|
||||
'airport_id' => function () {
|
||||
return factory(Airport::class)->create()->id;
|
||||
},
|
||||
'iata' => $faker->unique()->text(5),
|
||||
'icao' => $faker->unique()->text(5),
|
||||
'name' => $faker->text(50),
|
||||
'registration' => $faker->unique()->text(10),
|
||||
'hex_code' => ICAO::createHexCode(),
|
||||
'mtow' => $faker->randomFloat(2, 0, 50000),
|
||||
'zfw' => $faker->randomFloat(2, 0, 50000),
|
||||
'status' => AircraftStatus::ACTIVE,
|
||||
'state' => AircraftState::PARKED,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => function (array $pirep) {
|
||||
return $pirep['created_at'];
|
||||
},
|
||||
];
|
||||
});
|
||||
class AircraftFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Aircraft::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'subfleet_id' => fn () => Subfleet::factory()->create()->id,
|
||||
'airport_id' => fn () => Airport::factory()->create()->id,
|
||||
'iata' => $this->faker->unique()->text(5),
|
||||
'icao' => $this->faker->unique()->text(5),
|
||||
'name' => $this->faker->text(50),
|
||||
'registration' => $this->faker->unique()->text(10),
|
||||
'hex_code' => ICAO::createHexCode(),
|
||||
'mtow' => $this->faker->randomFloat(2, 0, 50000),
|
||||
'zfw' => $this->faker->randomFloat(2, 0, 50000),
|
||||
'status' => AircraftStatus::ACTIVE,
|
||||
'state' => AircraftState::PARKED,
|
||||
'created_at' => $this->faker->dateTimeBetween('-1 week')->format(DateTime::ATOM),
|
||||
'updated_at' => fn (array $pirep) => $pirep['created_at'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Airline;
|
||||
use Hashids\Hashids;
|
||||
|
||||
/*
|
||||
* Add any number of airports. Don't really care if they're real or not
|
||||
*/
|
||||
$factory->define(App\Models\Airline::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'icao' => function (array $apt) {
|
||||
$hashids = new Hashids(microtime(), 5);
|
||||
$mt = str_replace('.', '', microtime(true));
|
||||
class AirlineFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Airline::class;
|
||||
|
||||
return $hashids->encode($mt);
|
||||
},
|
||||
'iata' => function (array $apt) {
|
||||
return $apt['icao'];
|
||||
},
|
||||
'name' => $faker->sentence(3),
|
||||
'country' => $faker->country,
|
||||
'active' => 1,
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'icao' => function (array $apt): string {
|
||||
$hashids = new Hashids(microtime(), 5);
|
||||
$mt = str_replace('.', '', microtime(true));
|
||||
|
||||
return $hashids->encode($mt);
|
||||
},
|
||||
'iata' => fn (array $apt) => $apt['icao'],
|
||||
'name' => $this->faker->sentence(3),
|
||||
'country' => $this->faker->country,
|
||||
'active' => 1,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
/*
|
||||
* Create an ICAO for use in the factory.
|
||||
*/
|
||||
if (!function_exists('createFactoryICAO')) {
|
||||
function createFactoryICAO(): string
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Airport;
|
||||
|
||||
class AirportFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Airport::class;
|
||||
|
||||
protected array $usedIcaos = [];
|
||||
|
||||
/**
|
||||
* Generate a fake ICAO
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function createFactoryICAO(): string
|
||||
{
|
||||
$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
$max = strlen($characters) - 1;
|
||||
@@ -20,37 +39,34 @@ if (!function_exists('createFactoryICAO')) {
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => function () {
|
||||
do {
|
||||
$airport = $this->createFactoryICAO();
|
||||
} while (in_array($airport, $this->usedIcaos, true));
|
||||
|
||||
return $airport;
|
||||
},
|
||||
'icao' => fn (array $apt) => $apt['id'],
|
||||
'iata' => fn (array $apt) => $apt['id'],
|
||||
'name' => $this->faker->sentence(3),
|
||||
'country' => $this->faker->country,
|
||||
'timezone' => $this->faker->timezone,
|
||||
'lat' => $this->faker->latitude,
|
||||
'lon' => $this->faker->longitude,
|
||||
'hub' => false,
|
||||
'ground_handling_cost' => $this->faker->randomFloat(2, 0, 500),
|
||||
'fuel_100ll_cost' => $this->faker->randomFloat(2, 1, 10),
|
||||
'fuel_jeta_cost' => $this->faker->randomFloat(2, 1, 10),
|
||||
'fuel_mogas_cost' => $this->faker->randomFloat(2, 1, 10),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add any number of airports. Don't really care if they're real or not
|
||||
*/
|
||||
$factory->define(App\Models\Airport::class, function (Faker $faker) {
|
||||
$usedIcaos = [];
|
||||
|
||||
return [
|
||||
'id' => function () use ($usedIcaos) {
|
||||
do {
|
||||
$airport = createFactoryICAO();
|
||||
} while (in_array($airport, $usedIcaos, true));
|
||||
|
||||
return $airport;
|
||||
},
|
||||
'icao' => function (array $apt) {
|
||||
return $apt['id'];
|
||||
},
|
||||
'iata' => function (array $apt) {
|
||||
return $apt['id'];
|
||||
},
|
||||
'name' => $faker->sentence(3),
|
||||
'country' => $faker->country,
|
||||
'timezone' => $faker->timezone,
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'hub' => false,
|
||||
'ground_handling_cost' => $faker->randomFloat(2, 0, 500),
|
||||
'fuel_100ll_cost' => $faker->randomFloat(2, 1, 10),
|
||||
'fuel_jeta_cost' => $faker->randomFloat(2, 1, 10),
|
||||
'fuel_mogas_cost' => $faker->randomFloat(2, 1, 10),
|
||||
];
|
||||
});
|
||||
|
||||
34
app/Database/factories/AwardFactory.php
Normal file
34
app/Database/factories/AwardFactory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Award;
|
||||
|
||||
class AwardFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Award::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $this->faker->name,
|
||||
'description' => $this->faker->text(10),
|
||||
'ref_model' => null,
|
||||
'ref_model_params' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Award::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $faker->name,
|
||||
'description' => $faker->text(10),
|
||||
'ref_model' => null,
|
||||
'ref_model_params' => null,
|
||||
];
|
||||
});
|
||||
@@ -1,18 +1,39 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Enums\ExpenseType;
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Expense::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'airline_id' => null,
|
||||
'name' => $faker->text(20),
|
||||
'amount' => $faker->randomFloat(2, 100, 1000),
|
||||
'type' => ExpenseType::FLIGHT,
|
||||
'multiplier' => false,
|
||||
'ref_model' => \App\Models\Expense::class,
|
||||
'ref_model_id' => null,
|
||||
'active' => true,
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Enums\ExpenseType;
|
||||
use App\Models\Expense;
|
||||
|
||||
class ExpenseFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Expense::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'airline_id' => null,
|
||||
'name' => $this->faker->text(20),
|
||||
'amount' => $this->faker->randomFloat(2, 100, 1000),
|
||||
'type' => ExpenseType::FLIGHT,
|
||||
'multiplier' => false,
|
||||
'ref_model' => \App\Models\Expense::class,
|
||||
'ref_model_id' => null,
|
||||
'active' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Fare::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'code' => $faker->unique()->text(50),
|
||||
'name' => $faker->text(50),
|
||||
'price' => $faker->randomFloat(2, 100, 1000),
|
||||
'cost' => function (array $fare) {
|
||||
return round($fare['price'] / 2);
|
||||
},
|
||||
'capacity' => $faker->randomFloat(0, 20, 500),
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Fare;
|
||||
|
||||
class FareFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Fare::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'code' => $this->faker->unique()->text(50),
|
||||
'name' => $this->faker->text(50),
|
||||
'price' => $this->faker->randomFloat(2, 100, 1000),
|
||||
'cost' => fn (array $fare) => round($fare['price'] / 2),
|
||||
'capacity' => $this->faker->randomFloat(0, 20, 500),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Create flights
|
||||
*/
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Flight::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(10, 10000000),
|
||||
'airline_id' => function () {
|
||||
return factory(\App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
'flight_number' => $faker->unique()->numberBetween(10, 1000000),
|
||||
'route_code' => $faker->randomElement(['', $faker->text(5)]),
|
||||
'route_leg' => $faker->randomElement(['', $faker->numberBetween(0, 1000)]),
|
||||
'dpt_airport_id' => function () {
|
||||
return factory(\App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'arr_airport_id' => function () {
|
||||
return factory(\App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'alt_airport_id' => function () {
|
||||
return factory(\App\Models\Airport::class)->create()->id;
|
||||
},
|
||||
'distance' => $faker->numberBetween(1, 1000),
|
||||
'route' => null,
|
||||
'level' => 0,
|
||||
'dpt_time' => $faker->time(),
|
||||
'arr_time' => $faker->time(),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'load_factor' => $faker->randomElement([15, 20, 50, 90, 100]),
|
||||
'load_factor_variance' => $faker->randomElement([15, 20, 50, 90, 100]),
|
||||
'has_bid' => false,
|
||||
'active' => true,
|
||||
'visible' => true,
|
||||
'days' => 0,
|
||||
'start_date' => null,
|
||||
'end_date' => null,
|
||||
'created_at' => $faker->dateTimeBetween('-1 week', 'now'),
|
||||
'updated_at' => static function (array $flight) {
|
||||
return $flight['created_at'];
|
||||
},
|
||||
];
|
||||
});
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Flight;
|
||||
use DateTime;
|
||||
|
||||
class FlightFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Flight::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->faker->unique()->numberBetween(10, 10000000),
|
||||
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
|
||||
'flight_number' => $this->faker->unique()->numberBetween(10, 1000000),
|
||||
'route_code' => $this->faker->randomElement(['', $this->faker->text(5)]),
|
||||
'route_leg' => $this->faker->randomElement(
|
||||
['', $this->faker->numberBetween(0, 1000)]
|
||||
),
|
||||
'dpt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
|
||||
'arr_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
|
||||
'alt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
|
||||
'distance' => $this->faker->numberBetween(1, 1000),
|
||||
'route' => null,
|
||||
'level' => 0,
|
||||
'dpt_time' => $this->faker->time(),
|
||||
'arr_time' => $this->faker->time(),
|
||||
'flight_time' => $this->faker->numberBetween(60, 360),
|
||||
'load_factor' => $this->faker->randomElement([15, 20, 50, 90, 100]),
|
||||
'load_factor_variance' => $this->faker->randomElement([15, 20, 50, 90, 100]),
|
||||
'has_bid' => false,
|
||||
'active' => true,
|
||||
'visible' => true,
|
||||
'days' => 0,
|
||||
'start_date' => null,
|
||||
'end_date' => null,
|
||||
'created_at' => $this->faker->dateTimeBetween('-1 week')->format(
|
||||
DateTime::ATOM
|
||||
),
|
||||
'updated_at' => static fn (array $flight) => $flight['created_at'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Journal::class, function (Faker $faker) {
|
||||
return [
|
||||
'currency' => 'USD',
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Journal;
|
||||
|
||||
class JournalFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Journal::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'currency' => 'USD',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,39 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Journal;
|
||||
use App\Models\JournalTransaction;
|
||||
use Carbon\Carbon;
|
||||
use Faker\Generator as Faker;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
$factory->define(App\Models\JournalTransaction::class, function (Faker $faker) {
|
||||
return [
|
||||
'transaction_group' => Uuid::uuid4()->toString(),
|
||||
'journal_id' => function () {
|
||||
return factory(Journal::class)->create()->id;
|
||||
},
|
||||
'credit' => $faker->numberBetween(100, 10000),
|
||||
'debit' => $faker->numberBetween(100, 10000),
|
||||
'currency' => 'USD',
|
||||
'memo' => $faker->sentence(6),
|
||||
'post_date' => Carbon::now('UTC'),
|
||||
];
|
||||
});
|
||||
class JournalTransactionsFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = JournalTransaction::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'transaction_group' => Uuid::uuid4()->toString(),
|
||||
'journal_id' => fn () => Journal::factory()->create()->id,
|
||||
'credit' => $this->faker->numberBetween(100, 10000),
|
||||
'debit' => $this->faker->numberBetween(100, 10000),
|
||||
'currency' => 'USD',
|
||||
'memo' => $this->faker->sentence(6),
|
||||
'post_date' => Carbon::now('UTC')->toDateTimeString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Enums\NavaidType;
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Navdata::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => str_replace(' ', '', str_replace('.', '', $faker->unique()->text(5))),
|
||||
'name' => str_replace('.', '', $faker->unique()->word),
|
||||
'type' => $faker->randomElement([NavaidType::VOR, NavaidType::NDB]),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'freq' => $faker->randomFloat(2, 100, 1000),
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Enums\NavaidType;
|
||||
use App\Models\Navdata;
|
||||
|
||||
class NavdataFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Navdata::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => str_replace(' ', '', str_replace('.', '', $this->faker->unique()->text(5))),
|
||||
'name' => str_replace('.', '', $this->faker->unique()->word),
|
||||
'type' => $this->faker->randomElement([NavaidType::VOR, NavaidType::NDB]),
|
||||
'lat' => $this->faker->latitude,
|
||||
'lon' => $this->faker->longitude,
|
||||
'freq' => $this->faker->randomFloat(2, 100, 1000),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\News::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'user_id' => function () {
|
||||
return factory(\App\Models\User::class)->create()->id;
|
||||
},
|
||||
'subject' => $faker->text(),
|
||||
'body' => $faker->sentence,
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\News;
|
||||
|
||||
class NewsFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = News::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'user_id' => fn () => \App\Models\User::factory()->create()->id,
|
||||
'subject' => $this->faker->text(),
|
||||
'body' => $this->faker->sentence,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +1,74 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Airline;
|
||||
use App\Models\Enums\PirepSource;
|
||||
use App\Models\Enums\PirepState;
|
||||
use App\Models\Enums\PirepStatus;
|
||||
use App\Models\Flight;
|
||||
use App\Models\Pirep;
|
||||
use Carbon\Carbon;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
/*
|
||||
* Create a new PIREP
|
||||
*/
|
||||
$factory->define(App\Models\Pirep::class, function (Faker $faker) {
|
||||
$airline = factory(\App\Models\Airline::class)->create();
|
||||
$flight = factory(\App\Models\Flight::class)->create([
|
||||
'airline_id' => $airline->id,
|
||||
]);
|
||||
class PirepFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Pirep::class;
|
||||
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(10, 10000000),
|
||||
'airline_id' => function () use ($airline) {
|
||||
return $airline->id;
|
||||
},
|
||||
'user_id' => function () {
|
||||
return factory(\App\Models\User::class)->create()->id;
|
||||
},
|
||||
'aircraft_id' => function () {
|
||||
return factory(\App\Models\Aircraft::class)->create()->id;
|
||||
},
|
||||
'flight_id' => function () use ($flight) {
|
||||
return $flight->id;
|
||||
},
|
||||
'flight_number' => function () use ($flight) {
|
||||
return $flight->flight_number;
|
||||
},
|
||||
'route_code' => null,
|
||||
'route_leg' => null,
|
||||
'dpt_airport_id' => function () use ($flight) {
|
||||
return $flight->dpt_airport_id;
|
||||
},
|
||||
'arr_airport_id' => function () use ($flight) {
|
||||
return $flight->arr_airport_id;
|
||||
},
|
||||
'level' => $faker->numberBetween(20, 400),
|
||||
'distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'planned_distance' => $faker->randomFloat(2, 0, 6000),
|
||||
'flight_time' => $faker->numberBetween(60, 360),
|
||||
'planned_flight_time' => $faker->numberBetween(60, 360),
|
||||
'zfw' => $faker->randomFloat(2),
|
||||
'block_fuel' => $faker->randomFloat(2, 0, 1000),
|
||||
'fuel_used' => function (array $pirep) {
|
||||
return round($pirep['block_fuel'] * .9, 2); // 90% of the fuel loaded was used
|
||||
},
|
||||
'block_on_time' => Carbon::now('UTC'),
|
||||
'block_off_time' => function (array $pirep) {
|
||||
return $pirep['block_on_time']->subMinutes($pirep['flight_time']);
|
||||
},
|
||||
'route' => $faker->text(200),
|
||||
'notes' => $faker->text(200),
|
||||
'source' => $faker->randomElement([PirepSource::MANUAL, PirepSource::ACARS]),
|
||||
'source_name' => 'TestFactory',
|
||||
'state' => PirepState::PENDING,
|
||||
'status' => PirepStatus::SCHEDULED,
|
||||
'submitted_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'created_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'updated_at' => function (array $pirep) {
|
||||
return $pirep['created_at'];
|
||||
},
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
/** @var Airline $airline */
|
||||
$airline = Airline::factory()->create();
|
||||
|
||||
/** @var Flight $flight */
|
||||
$flight = Flight::factory()->create(['airline_id' => $airline->id]);
|
||||
|
||||
return [
|
||||
'id' => $this->faker->unique()->numberBetween(10, 10000000),
|
||||
'airline_id' => fn () => $airline->id,
|
||||
'user_id' => fn () => \App\Models\User::factory()->create()->id,
|
||||
'aircraft_id' => fn () => \App\Models\Aircraft::factory()->create()->id,
|
||||
'flight_id' => fn () => $flight->id,
|
||||
'flight_number' => fn () => $flight->flight_number,
|
||||
'route_code' => null,
|
||||
'route_leg' => null,
|
||||
'dpt_airport_id' => fn () => $flight->dpt_airport_id,
|
||||
'arr_airport_id' => fn () => $flight->arr_airport_id,
|
||||
'level' => $this->faker->numberBetween(20, 400),
|
||||
'distance' => $this->faker->randomFloat(2, 0, 6000),
|
||||
'planned_distance' => $this->faker->randomFloat(2, 0, 6000),
|
||||
'flight_time' => $this->faker->numberBetween(60, 360),
|
||||
'planned_flight_time' => $this->faker->numberBetween(60, 360),
|
||||
'zfw' => $this->faker->randomFloat(2),
|
||||
'block_fuel' => $this->faker->randomFloat(2, 0, 1000),
|
||||
'fuel_used' => fn (array $pirep) => round($pirep['block_fuel'] * .9, 2),
|
||||
'block_on_time' => Carbon::now('UTC'),
|
||||
'block_off_time' => fn (array $pirep) => $pirep['block_on_time']->subMinutes(
|
||||
$pirep['flight_time']
|
||||
),
|
||||
'route' => $this->faker->text(200),
|
||||
'notes' => $this->faker->text(200),
|
||||
'source' => $this->faker->randomElement(
|
||||
[PirepSource::MANUAL, PirepSource::ACARS]
|
||||
),
|
||||
'source_name' => 'TestFactory',
|
||||
'state' => PirepState::PENDING,
|
||||
'status' => PirepStatus::SCHEDULED,
|
||||
'submitted_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'created_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'updated_at' => fn (array $pirep) => $pirep['created_at'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
/*
|
||||
* id: 2
|
||||
name: Junior First Officer
|
||||
hours: 10
|
||||
auto_approve_acars: 1
|
||||
auto_approve_manual: 1
|
||||
*/
|
||||
$factory->define(App\Models\Rank::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $faker->unique()->text(50),
|
||||
'hours' => $faker->numberBetween(10, 50),
|
||||
'acars_base_pay_rate' => $faker->numberBetween(10, 100),
|
||||
'manual_base_pay_rate' => $faker->numberBetween(10, 100),
|
||||
'auto_approve_acars' => 0,
|
||||
'auto_approve_manual' => 0,
|
||||
'auto_promote' => 0,
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Rank;
|
||||
|
||||
class RankFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Rank::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $this->faker->unique()->text(50),
|
||||
'hours' => $this->faker->numberBetween(10, 50),
|
||||
'acars_base_pay_rate' => $this->faker->numberBetween(10, 100),
|
||||
'manual_base_pay_rate' => $this->faker->numberBetween(10, 100),
|
||||
'auto_approve_acars' => 0,
|
||||
'auto_approve_manual' => 0,
|
||||
'auto_promote' => 0,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Role::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $faker->name,
|
||||
'display_name' => $faker->name,
|
||||
'read_only' => false,
|
||||
'disable_activity_checks' => $faker->boolean(),
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Role;
|
||||
|
||||
class RoleFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Role::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'name' => $this->faker->name,
|
||||
'display_name' => $this->faker->name,
|
||||
'read_only' => false,
|
||||
'disable_activity_checks' => $this->faker->boolean(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
38
app/Database/factories/SimBriefFactory.php
Normal file
38
app/Database/factories/SimBriefFactory.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\SimBrief;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class SimBriefFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = SimBrief::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'id' => $this->faker->unique()->numberBetween(10, 10000000),
|
||||
'user_id' => null,
|
||||
'flight_id' => null,
|
||||
'pirep_id' => null,
|
||||
'acars_xml' => '',
|
||||
'ofp_xml' => '',
|
||||
'created_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'updated_at' => fn (array $sb) => $sb['created_at'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\SimBrief::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(10, 10000000),
|
||||
'user_id' => null,
|
||||
'flight_id' => null,
|
||||
'pirep_id' => null,
|
||||
'acars_xml' => '',
|
||||
'ofp_xml' => '',
|
||||
'created_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'updated_at' => function (array $sb) {
|
||||
return $sb['created_at'];
|
||||
},
|
||||
];
|
||||
});
|
||||
@@ -1,15 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
$factory->define(App\Models\Subfleet::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => null,
|
||||
'airline_id' => function () {
|
||||
return factory(\App\Models\Airline::class)->create()->id;
|
||||
},
|
||||
'name' => $faker->unique()->text(50),
|
||||
'type' => $faker->unique()->text(7),
|
||||
'ground_handling_multiplier' => $faker->numberBetween(50, 200),
|
||||
];
|
||||
});
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Subfleet;
|
||||
|
||||
class SubfleetFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Subfleet::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'id' => null,
|
||||
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
|
||||
'name' => $this->faker->unique()->text(50),
|
||||
'type' => $this->faker->unique()->text(7),
|
||||
'ground_handling_multiplier' => $this->faker->numberBetween(50, 200),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,54 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace App\Database\Factories;
|
||||
|
||||
use App\Contracts\Factory;
|
||||
use App\Models\Airline;
|
||||
use App\Models\Enums\UserState;
|
||||
use Faker\Generator as Faker;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
$factory->define(App\Models\User::class, function (Faker $faker) {
|
||||
static $password;
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = User::class;
|
||||
|
||||
return [
|
||||
'id' => null,
|
||||
'pilot_id' => null,
|
||||
'name' => $faker->name,
|
||||
'email' => $faker->safeEmail,
|
||||
'password' => $password ?: $password = Hash::make('secret'),
|
||||
'api_key' => $faker->sha1,
|
||||
'airline_id' => function () {
|
||||
return factory(Airline::class)->create()->id;
|
||||
},
|
||||
'rank_id' => 1,
|
||||
'flights' => $faker->numberBetween(0, 1000),
|
||||
'flight_time' => $faker->numberBetween(0, 10000),
|
||||
'transfer_time' => $faker->numberBetween(0, 10000),
|
||||
'state' => UserState::ACTIVE,
|
||||
'remember_token' => $faker->unique()->text(5),
|
||||
];
|
||||
});
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private static string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
if (empty(self::$password)) {
|
||||
self::$password = Hash::make('secret');
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => null,
|
||||
'pilot_id' => null,
|
||||
'name' => $this->faker->name,
|
||||
'email' => $this->faker->safeEmail,
|
||||
'password' => self::$password,
|
||||
'api_key' => $this->faker->sha1,
|
||||
'airline_id' => fn () => Airline::factory()->create()->id,
|
||||
'rank_id' => 1,
|
||||
'flights' => $this->faker->numberBetween(0, 1000),
|
||||
'flight_time' => $this->faker->numberBetween(0, 10000),
|
||||
'transfer_time' => $this->faker->numberBetween(0, 10000),
|
||||
'state' => UserState::ACTIVE,
|
||||
'remember_token' => $this->faker->unique()->text(5),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use App\Services\Installer\SeederService;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateSettingsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
private $seederSvc;
|
||||
|
||||
public function __construct()
|
||||
@@ -50,4 +49,4 @@ class CreateSettingsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use App\Models\Pirep;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -55,4 +54,4 @@ class CreateUsersTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class RolesPermissionsTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
// Create table for storing roles
|
||||
@@ -82,4 +82,4 @@ class RolesPermissionsTables extends Migration
|
||||
Schema::dropIfExists('role_user');
|
||||
Schema::dropIfExists('roles');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
@@ -19,4 +18,4 @@ class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSessionsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
@@ -22,4 +21,4 @@ class CreateSessionsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAirlinesTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('airlines', function (Blueprint $table) {
|
||||
@@ -31,4 +30,4 @@ class CreateAirlinesTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('airlines');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use App\Models\Enums\AircraftState;
|
||||
use App\Models\Enums\AircraftStatus;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAircraftsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('aircraft', function (Blueprint $table) {
|
||||
@@ -34,4 +33,4 @@ class CreateAircraftsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('aircraft');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateFaresTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('fares', function (Blueprint $table) {
|
||||
@@ -24,4 +23,4 @@ class CreateFaresTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('fares');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateAirportsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('airports', function (Blueprint $table) {
|
||||
@@ -33,4 +32,4 @@ class CreateAirportsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('airports');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use App\Contracts\Model;
|
||||
use App\Models\Enums\FlightType;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateFlightTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('flights', function (Blueprint $table) {
|
||||
@@ -98,4 +97,4 @@ class CreateFlightTables extends Migration
|
||||
Schema::drop('flight_subfleet');
|
||||
Schema::drop('flights');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateRanksTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ranks', function (Blueprint $table) {
|
||||
@@ -29,4 +28,4 @@ class CreateRanksTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('ranks');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateSubfleetTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('subfleets', function (Blueprint $table) {
|
||||
@@ -51,4 +50,4 @@ class CreateSubfleetTables extends Migration
|
||||
Schema::dropIfExists('subfleet_fare');
|
||||
Schema::dropIfExists('subfleet_rank');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use App\Models\Enums\PirepState;
|
||||
use App\Models\Enums\PirepStatus;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreatePirepTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -106,4 +105,4 @@ class CreatePirepTables extends Migration
|
||||
Schema::dropIfExists('pirep_fields');
|
||||
Schema::dropIfExists('pirep_field_values');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use App\Contracts\Model;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateBidsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('bids', function (Blueprint $table) {
|
||||
@@ -24,4 +23,4 @@ class CreateBidsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('bids');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJobsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
@@ -23,4 +22,4 @@ class CreateJobsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFailedJobsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
@@ -22,4 +21,4 @@ class CreateFailedJobsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNavdataTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
/*
|
||||
@@ -30,4 +29,4 @@ class CreateNavdataTables extends Migration
|
||||
{
|
||||
Schema::dropIfExists('navdata');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use App\Contracts\Model;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAcarsTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('acars', function (Blueprint $table) {
|
||||
@@ -43,4 +42,4 @@ class CreateAcarsTables extends Migration
|
||||
{
|
||||
Schema::dropIfExists('acars');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateStatsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('stats', function (Blueprint $table) {
|
||||
@@ -24,4 +23,4 @@ class CreateStatsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('stats');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNewsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('news', function (Blueprint $table) {
|
||||
@@ -21,4 +20,4 @@ class CreateNewsTable extends Migration
|
||||
{
|
||||
Schema::drop('news');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Awards\Awards\PilotFlightAwards;
|
||||
|
||||
class CreateAwardsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('awards', function (Blueprint $table) {
|
||||
@@ -52,4 +51,4 @@ class CreateAwardsTable extends Migration
|
||||
Schema::dropIfExists('awards');
|
||||
Schema::dropIfExists('user_awards');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateExpensesTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('expenses', function (Blueprint $table) {
|
||||
@@ -34,4 +33,4 @@ class CreateExpensesTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('expenses');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJournalTransactionsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('journal_transactions', function (Blueprint $table) {
|
||||
@@ -33,4 +32,4 @@ class CreateJournalTransactionsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('journal_transactions');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJournalsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('journals', function (Blueprint $table) {
|
||||
@@ -23,4 +22,4 @@ class CreateJournalsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('journals');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLedgersTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -30,4 +29,4 @@ class CreateLedgersTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('ledgers');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use App\Contracts\Model;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFilesTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Create the files table. Acts as a morphable
|
||||
*
|
||||
@@ -40,4 +39,4 @@ class CreateFilesTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('files');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddReadonlyToRoles extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('roles', static function (Blueprint $table) {
|
||||
@@ -25,4 +24,4 @@ class AddReadonlyToRoles extends Migration
|
||||
$table->dropColumn('read_only');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,8 +12,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
* 3. Iterate through all of the users and set their `id` to the `pilot_id`
|
||||
* 4. Change the other tables column types that reference `user_id`
|
||||
*/
|
||||
class UsersAddPilotId extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', static function (Blueprint $table) {
|
||||
@@ -33,4 +32,4 @@ class UsersAddPilotId extends Migration
|
||||
$table->dropColumn('pilot_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNotificationsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
@@ -22,4 +21,4 @@ class CreateNotificationsTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,8 +9,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Change the PIREP state column to be a TINYINT
|
||||
*/
|
||||
class PirepsChangeStateType extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
// Migrate the old rejected state
|
||||
@@ -23,4 +22,4 @@ class PirepsChangeStateType extends Migration
|
||||
$table->unsignedSmallInteger('state')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,12 +8,11 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `flight_id` column to the PIREPs table
|
||||
*/
|
||||
class PirepsAddFlightId extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pireps', function (Blueprint $table) {
|
||||
$table->string('flight_id', Model::ID_MAX_LENGTH)->nullable()->after('aircraft_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `flight_type` column to the expenses table
|
||||
*/
|
||||
class ExpensesAddFlightType extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('expenses', function (Blueprint $table) {
|
||||
@@ -24,4 +23,4 @@ class ExpensesAddFlightType extends Migration
|
||||
$table->dropColumn('flight_type');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,8 +6,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Turn the airport coordinates and other lat/lon coords into decimal type
|
||||
*/
|
||||
class ModifyAirportsCoordinates extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -25,4 +24,4 @@ class ModifyAirportsCoordinates extends Migration
|
||||
$table->decimal('lon', 11, 5)->change()->default(0.0)->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,12 +6,11 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Allow the flight field value to be nullable
|
||||
*/
|
||||
class FlightFieldNullable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('flight_field_values', function ($table) {
|
||||
$table->text('value')->change()->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `load_factor` and `load_factor_variance` columns to the expenses table
|
||||
*/
|
||||
class FlightsAddLoadFactor extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('flights', function (Blueprint $table) {
|
||||
@@ -29,4 +28,4 @@ class FlightsAddLoadFactor extends Migration
|
||||
$table->dropColumn('load_factor_variance');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `pilot_pay` column for a fixed amount to pay to a pilot for a flight
|
||||
*/
|
||||
class FlightsAddPilotPay extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('flights', function (Blueprint $table) {
|
||||
@@ -24,4 +23,4 @@ class FlightsAddPilotPay extends Migration
|
||||
$table->dropColumn('pilot_pay');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,8 +8,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `pilot_pay` column for a fixed amount to pay to a pilot for a flight
|
||||
*/
|
||||
class FaresAddType extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('fares', function (Blueprint $table) {
|
||||
@@ -19,4 +18,4 @@ class FaresAddType extends Migration
|
||||
->after('capacity');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Increase string ID lengths because of collisions
|
||||
*/
|
||||
class IncreaseIdLengths extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
$tables = [
|
||||
@@ -33,4 +32,4 @@ class IncreaseIdLengths extends Migration
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,12 +7,11 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Remove the unique index from subfleets.type
|
||||
*/
|
||||
class RemoveSubfleetTypeIndex extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('subfleets', function (Blueprint $table) {
|
||||
$table->dropUnique(['type']);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a table to store the Simbrief data
|
||||
*/
|
||||
class AddSimbriefTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('simbrief', function (Blueprint $table) {
|
||||
@@ -31,4 +30,4 @@ class AddSimbriefTable extends Migration
|
||||
{
|
||||
Schema::drop('simbrief');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,8 +9,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
* Create the pages
|
||||
* https://github.com/nabeelio/phpvms/issues/641
|
||||
*/
|
||||
class CreatePages extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pages', function (Blueprint $table) {
|
||||
@@ -32,4 +31,4 @@ class CreatePages extends Migration
|
||||
{
|
||||
Schema::dropIfExists('pages');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,12 +4,11 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AirlineRemoveNullable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('airlines', function (Blueprint $table) {
|
||||
$table->dropUnique(['iata']);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,12 +4,11 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class PageIconNullable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->string('icon')->change()->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,8 +8,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
* Add a `link` column and make the body optional. Also add a "new_window" bool
|
||||
* which determines if we open this link in a new window or not
|
||||
*/
|
||||
class PagesAddLink extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
@@ -30,4 +29,4 @@ class PagesAddLink extends Migration
|
||||
$table->dropColumn('new_window');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,8 +8,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add two tables for holding user fields and the values
|
||||
*/
|
||||
class CreateUserFields extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
/*
|
||||
@@ -39,4 +38,4 @@ class CreateUserFields extends Migration
|
||||
$table->index(['user_field_id', 'user_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `mtow` column for the max takeoff weight
|
||||
*/
|
||||
class AircraftAddMtow extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('aircraft', function (Blueprint $table) {
|
||||
@@ -25,4 +24,4 @@ class AircraftAddMtow extends Migration
|
||||
$table->dropColumn('mtow');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateModulesTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('modules', function (Blueprint $table) {
|
||||
@@ -26,4 +25,4 @@ class CreateModulesTable extends Migration
|
||||
{
|
||||
Schema::dropIfExists('modules');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,12 +7,11 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Change the pages body column type to a Medium Text, max size of 16MB
|
||||
*/
|
||||
class ModifyPagesSize extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->mediumText('body')->change()->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Change the downloads link size
|
||||
*/
|
||||
class ModifyDownloadLinkSize extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('files', function (Blueprint $table) {
|
||||
@@ -16,4 +15,4 @@ class ModifyDownloadLinkSize extends Migration
|
||||
$table->mediumText('path')->change()->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a hub to the subfleet is
|
||||
*/
|
||||
class AddHubToSubfleets extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('subfleets', function (Blueprint $table) {
|
||||
@@ -17,4 +16,4 @@ class AddHubToSubfleets extends Migration
|
||||
->after('airline_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,12 +7,11 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Change the vertical speed for the acars table to a double
|
||||
*/
|
||||
class ChangeAcarsVsType extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('acars', function (Blueprint $table) {
|
||||
$table->float('vs')->change()->default(0.0)->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Bring the sessions table in line with the latest
|
||||
*/
|
||||
class UpdateSessionsTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('sessions', function (Blueprint $table) {
|
||||
@@ -16,4 +15,4 @@ class UpdateSessionsTable extends Migration
|
||||
$table->index('last_activity');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a `fuel_onboard` column for recording what is left in tanks
|
||||
*/
|
||||
class AircraftAddFuelonboard extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('aircraft', function (Blueprint $table) {
|
||||
@@ -18,4 +17,4 @@ class AircraftAddFuelonboard extends Migration
|
||||
->after('zfw');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a SimBrief Type to subfleet
|
||||
*/
|
||||
class AddSbtypeToSubfleets extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('subfleets', function (Blueprint $table) {
|
||||
@@ -17,4 +16,4 @@ class AddSbtypeToSubfleets extends Migration
|
||||
->after('type');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a hub to the subfleet is
|
||||
*/
|
||||
class AddAircraftToSimbrief extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('simbrief', function (Blueprint $table) {
|
||||
@@ -21,4 +20,4 @@ class AddAircraftToSimbrief extends Migration
|
||||
$table->mediumText('fare_data')->nullable()->after('ofp_xml');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Add a hub to the subfleet is
|
||||
*/
|
||||
class AddKvpTable extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::create('kvp', function (Blueprint $table) {
|
||||
@@ -16,4 +15,4 @@ class AddKvpTable extends Migration
|
||||
$table->string('value');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDisableactivitychecksToRoles extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -31,4 +30,4 @@ class AddDisableactivitychecksToRoles extends Migration
|
||||
$table->dropColumn('disable_activity_checks');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RemoveSettingRemoveBidOnAccept extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -16,4 +15,4 @@ class RemoveSettingRemoveBidOnAccept extends Migration
|
||||
->where(['key' => 'pireps.remove_bid_on_accept'])
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,8 +10,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
* According to FAA and EASA, callsigns must be maximum 7 chars in which first 3 chars is
|
||||
* airline ICAO code remaining rest can be used freely according to airline's choices
|
||||
*/
|
||||
class FlightsAddAlphanumericCallsign extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('flights', function (Blueprint $table) {
|
||||
@@ -27,4 +26,4 @@ class FlightsAddAlphanumericCallsign extends Migration
|
||||
$table->dropColumn('callsign');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,8 +6,7 @@ use App\Services\Installer\ConfigService;
|
||||
/**
|
||||
* Migrate the configuration files
|
||||
*/
|
||||
class MigrateConfigs extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
/** @var ConfigService $configSvc */
|
||||
@@ -18,4 +17,4 @@ class MigrateConfigs extends Migration
|
||||
public function down()
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,8 +8,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
* Increase Airport ICAO size to 5 chars
|
||||
* https://github.com/nabeelio/phpvms/issues/1052
|
||||
*/
|
||||
class IncreaseIcaoSizes extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('airports', function (Blueprint $table) {
|
||||
@@ -23,4 +22,4 @@ class IncreaseIcaoSizes extends Migration
|
||||
$table->string('alt_airport_id', 5)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RemoveSettingSimbriefExpireDays extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -16,4 +15,4 @@ class RemoveSettingSimbriefExpireDays extends Migration
|
||||
->where(['key' => 'simbrief.expire_days'])
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,8 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DiscordFields extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
// Delete the old Discord fields and then a webhook will get added
|
||||
@@ -29,4 +28,4 @@ class DiscordFields extends Migration
|
||||
->after('rank_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class DiscordPrivateChannelId extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
// Add a field to the user to enter their own Discord ID
|
||||
@@ -15,4 +14,4 @@ class DiscordPrivateChannelId extends Migration
|
||||
->after('discord_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,8 +4,7 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTypeRatingTables extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasTable('typeratings')) {
|
||||
@@ -50,4 +49,4 @@ class AddTypeRatingTables extends Migration
|
||||
Schema::dropIfExists('typerating_user');
|
||||
Schema::dropIfExists('typerating_subfleet');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,12 +4,11 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddHubToAircraft extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('aircraft', function (Blueprint $table) {
|
||||
$table->string('hub_id', 5)->nullable()->after('airport_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,12 +4,11 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateAwardsAddActive extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('awards', function (Blueprint $table) {
|
||||
$table->boolean('active')->default(true)->nullable()->after('ref_model_params');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,12 +4,11 @@ use App\Contracts\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UpdateUsersAddNotes extends Migration
|
||||
{
|
||||
return new class() extends Migration {
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->mediumText('notes')->nullable()->after('remember_token');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Contracts\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class() extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::table('roles')
|
||||
->where(['name' => 'admin'])
|
||||
->update(['disable_activity_checks' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -56,6 +56,12 @@ users:
|
||||
opt_in: 0
|
||||
toc_accepted: 1
|
||||
|
||||
roles:
|
||||
- id: 2
|
||||
name: pilot
|
||||
display_name: Pilot
|
||||
description: A regular pilot
|
||||
|
||||
role_user:
|
||||
- user_id: 1
|
||||
role_id: 1
|
||||
|
||||
@@ -61,6 +61,27 @@
|
||||
options: ''
|
||||
type: boolean
|
||||
description: Record the user's IP address on register/login
|
||||
- key: captcha.enabled
|
||||
name: 'hCaptcha Enabled'
|
||||
group: captcha
|
||||
value: false
|
||||
options: ''
|
||||
type: boolean
|
||||
description: Is hCaptcha enabled
|
||||
- key: captcha.site_key
|
||||
name: 'hCaptcha Site Key'
|
||||
group: captcha
|
||||
value: ''
|
||||
options: ''
|
||||
type: text
|
||||
description: Your hCaptcha Site Key
|
||||
- key: captcha.secret_key
|
||||
name: 'hCaptcha Secret Key'
|
||||
group: captcha
|
||||
value: ''
|
||||
options: ''
|
||||
type: text
|
||||
description: Your hCaptcha Secret Key
|
||||
- key: units.currency
|
||||
name: 'Currency'
|
||||
group: units
|
||||
|
||||
Reference in New Issue
Block a user