Compare commits
95
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5450691a99 | ||
|
|
a952071cb4 | ||
|
|
157e0d830c | ||
|
|
a5b83185f5 | ||
|
|
29ff0758a7 | ||
|
|
be74d99ae8 | ||
|
|
53de2e3229 | ||
|
|
80a90c6e3c | ||
|
|
854ed9b92c | ||
|
|
46b17b5c04 | ||
|
|
0068b1215a | ||
|
|
984c1e0cec | ||
|
|
ad8b8e8945 | ||
|
|
2b0056b7c5 | ||
|
|
319a9fc8e1 | ||
|
|
a037597a21 | ||
|
|
4026fe9149 | ||
|
|
828319035b | ||
|
|
18e1d63760 | ||
|
|
4bda494c6b | ||
|
|
a5513b6fbb | ||
|
|
e4972eaae3 | ||
|
|
e95e61d4b4 | ||
|
|
f92912dff4 | ||
|
|
f62c607138 | ||
|
|
d1a3155653 | ||
|
|
883e8786e0 | ||
|
|
fb44b73f44 | ||
|
|
7379e93c46 | ||
|
|
d4bb5605de | ||
|
|
8ecc096bf7 | ||
|
|
6b5cf38224 | ||
|
|
2ecf366670 | ||
|
|
a7981c0a87 | ||
|
|
9cf07c47c7 | ||
|
|
8f4219bc95 | ||
|
|
eae345efa7 | ||
|
|
be15426b5b | ||
|
|
7e4c652330 | ||
|
|
ced2c150b7 | ||
|
|
a2de532f72 | ||
|
|
a52d844719 | ||
|
|
fd814bc79e | ||
|
|
0fa00206ce | ||
|
|
a58237b04b | ||
|
|
dc7efc981c | ||
|
|
060bebf8fe | ||
|
|
aaaf2e7c00 | ||
|
|
1be68d1e63 | ||
|
|
b83f7dcac8 | ||
|
|
c5de2fd8b1 | ||
|
|
b85d0e6a3e | ||
|
|
b37bd2cd7b | ||
|
|
584d37f230 | ||
|
|
1c9d1c1733 | ||
|
|
cd18442207 | ||
|
|
716ba38b6d | ||
|
|
c0514b381b | ||
|
|
5803487d51 | ||
|
|
ca220f1cdf | ||
|
|
75a0a4c87a | ||
|
|
3b6800077f | ||
|
|
bf878a98a4 | ||
|
|
d001704880 | ||
|
|
5371989921 | ||
|
|
6c553569bf | ||
|
|
9eb7dd6913 | ||
|
|
dc007f6d9e | ||
|
|
193fbd369d | ||
|
|
151f188886 | ||
|
|
69d89511be | ||
|
|
48087fb05f | ||
|
|
c702b01a87 | ||
|
|
0a5194b92e | ||
|
|
24aca506fc | ||
|
|
365e33f5f8 | ||
|
|
7a75e0f5ad | ||
|
|
93da2ca061 | ||
|
|
5363e4aa0f | ||
|
|
95a40d3565 | ||
|
|
98aa362935 | ||
|
|
b6603bd178 | ||
|
|
2c539d349d | ||
|
|
5df28eb027 | ||
|
|
0dbf8b8652 | ||
|
|
5856f88a0c | ||
|
|
5f9b9399e9 | ||
|
|
77fe6679ce | ||
|
|
435fa32663 | ||
|
|
78ca06e9dc | ||
|
|
2dd3dd5814 | ||
|
|
ac7a5a65e5 | ||
|
|
c5ab0978db | ||
|
|
8398d94c0a | ||
|
|
1db3295213 |
@@ -1,6 +1,10 @@
|
|||||||
#
|
#
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.js]
|
[*.js]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
Executable → Regular
+7
-71
@@ -1,52 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ "$TRAVIS" != "true" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $TRAVIS_BUILD_DIR
|
|
||||||
|
|
||||||
if test "$TRAVIS_TAG"; then
|
|
||||||
VERSION=$TRAVIS_TAG
|
|
||||||
|
|
||||||
# Pass in the tag as the version to write out
|
|
||||||
php artisan phpvms:version --write --write-full-version "${VERSION}"
|
|
||||||
FULL_VERSION=$(php artisan phpvms:version)
|
|
||||||
else
|
|
||||||
echo "On branch $TRAVIS_BRANCH"
|
|
||||||
|
|
||||||
if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then
|
|
||||||
echo "Not on valid branch, exiting"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Write the version out but place the branch ID in there
|
|
||||||
# This is only for the dev branch
|
|
||||||
BASE_VERSION=$(php artisan phpvms:version --base-only)
|
|
||||||
|
|
||||||
# This now includes the pre-release version, so "-dev" by default
|
|
||||||
VERSION=${BASE_VERSION}
|
|
||||||
|
|
||||||
# Don't pass in a version here, just write out the latest hash
|
|
||||||
php artisan phpvms:version --write "${VERSION}"
|
|
||||||
FULL_VERSION=$(php artisan phpvms:version)
|
|
||||||
fi
|
|
||||||
|
|
||||||
FILE_NAME="phpvms-${VERSION}"
|
|
||||||
TAR_NAME="$FILE_NAME.tar.gz"
|
|
||||||
ZIP_NAME="$FILE_NAME.zip"
|
|
||||||
|
|
||||||
echo "Version: ${VERSION}"
|
echo "Version: ${VERSION}"
|
||||||
echo "Full Version: ${FULL_VERSION}"
|
echo "Full Version: ${FULL_VERSION}"
|
||||||
echo "Package name: ${TAR_NAME}"
|
echo "Package name: ${TAR_NAME}"
|
||||||
|
echo "Current directory: ${BASE_DIR}"
|
||||||
echo "==========================="
|
|
||||||
|
|
||||||
echo "Cleaning files"
|
echo "Cleaning files"
|
||||||
|
|
||||||
rm -rf vendor
|
|
||||||
composer install --no-dev --prefer-dist --no-interaction --verbose
|
|
||||||
|
|
||||||
# Leftover individual files to delete
|
# Leftover individual files to delete
|
||||||
declare -a remove_files=(
|
declare -a remove_files=(
|
||||||
.git
|
.git
|
||||||
@@ -107,44 +67,20 @@ mkdir -p storage/framework/cache
|
|||||||
mkdir -p storage/framework/sessions
|
mkdir -p storage/framework/sessions
|
||||||
mkdir -p storage/framework/views
|
mkdir -p storage/framework/views
|
||||||
|
|
||||||
# Regenerate the autoloader and classes
|
|
||||||
composer dump-autoload
|
|
||||||
make clean
|
|
||||||
|
|
||||||
cd /tmp
|
cd /tmp
|
||||||
ls -al $TRAVIS_BUILD_DIR/../
|
|
||||||
|
|
||||||
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR .
|
ls -al $BASE_DIR/../
|
||||||
|
|
||||||
|
tar -czf $TAR_NAME -C $BASE_DIR .
|
||||||
sha256sum $TAR_NAME >"$TAR_NAME.sha256"
|
sha256sum $TAR_NAME >"$TAR_NAME.sha256"
|
||||||
tar2zip $TAR_NAME
|
tar2zip $TAR_NAME
|
||||||
sha256sum $ZIP_NAME >"$ZIP_NAME.sha256"
|
sha256sum $ZIP_NAME >"$ZIP_NAME.sha256"
|
||||||
|
|
||||||
ls -al /tmp
|
ls -al /tmp
|
||||||
|
|
||||||
echo "Uploading to S3"
|
echo "Moving to dist"
|
||||||
mkdir -p $TRAVIS_BUILD_DIR/build
|
mkdir -p $BASE_DIR/dist
|
||||||
cd $TRAVIS_BUILD_DIR/build
|
cd $BASE_DIR/dist
|
||||||
|
|
||||||
mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" "/tmp/$ZIP_NAME.sha256" .
|
mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" "/tmp/$ZIP_NAME.sha256" .
|
||||||
artifacts upload --target-paths "/" $ZIP_NAME $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256 $ZIP_NAME.sha256
|
|
||||||
|
|
||||||
# Upload the version for a tagged release. Move to a version file in different
|
|
||||||
# tags. Within phpVMS, we have an option of which version to track in the admin
|
|
||||||
if test "$TRAVIS_TAG"; then
|
|
||||||
echo "Uploading release version file"
|
|
||||||
cp "$TRAVIS_BUILD_DIR/VERSION" release_version
|
|
||||||
artifacts upload --target-paths "/" release_version
|
|
||||||
else
|
|
||||||
echo "Uploading ${TRAVIS_BRANCH}_version file"
|
|
||||||
cp $TRAVIS_BUILD_DIR/VERSION ${TRAVIS_BRANCH}_version
|
|
||||||
artifacts upload --target-paths "/" ${TRAVIS_BRANCH}_version
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" != "dev" ]; then
|
|
||||||
# echo "Skipping Discord branch update broadcast"
|
|
||||||
#else
|
|
||||||
curl -X POST \
|
|
||||||
--data "{\"content\": \"A new build is available at http://downloads.phpvms.net/$TAR_NAME (${FULL_VERSION})\"}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
$DISCORD_WEBHOOK_URL
|
|
||||||
#fi
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if test "$GIT_TAG_NAME"; then
|
||||||
|
export VERSION=$GIT_TAG_NAME
|
||||||
|
|
||||||
|
# Pass in the tag as the version to write out
|
||||||
|
php artisan phpvms:version --write --write-full-version "${VERSION}"
|
||||||
|
export FULL_VERSION=$(php artisan phpvms:version)
|
||||||
|
else
|
||||||
|
export BRANCH=${GITHUB_REF##*/}
|
||||||
|
echo "On branch $BRANCH"
|
||||||
|
|
||||||
|
# Write the version out but place the branch ID in there
|
||||||
|
# This is only for the dev branch
|
||||||
|
export BASE_VERSION=$(php artisan phpvms:version --base-only)
|
||||||
|
|
||||||
|
# This now includes the pre-release version, so "-dev" by default
|
||||||
|
export VERSION=${BASE_VERSION}
|
||||||
|
|
||||||
|
# Don't pass in a version here, just write out the latest hash
|
||||||
|
php artisan phpvms:version --write "${VERSION}"
|
||||||
|
export FULL_VERSION=$(php artisan phpvms:version)
|
||||||
|
fi
|
||||||
|
|
||||||
|
export FILE_NAME="phpvms-${VERSION}"
|
||||||
|
export TAR_NAME="$FILE_NAME.tar.gz"
|
||||||
|
export ZIP_NAME="$FILE_NAME.zip"
|
||||||
|
export BASE_DIR=`pwd`
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#environment-files
|
||||||
|
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
|
||||||
|
echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV
|
||||||
|
echo "TAR_NAME=${TAR_NAME}" >> $GITHUB_ENV
|
||||||
|
echo "ZIP_NAME=${ZIP_NAME}" >> $GITHUB_ENV
|
||||||
|
echo "BASE_DIR=${BASE_DIR}" >> $GITHUB_ENV
|
||||||
|
echo "DISCORD_MSG=A new build is available at http://downloads.phpvms.net/$TAR_NAME (${FULL_VERSION})" >> $GITHUB_ENV
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
name: 'Build'
|
||||||
|
on: ['push', 'pull_request', 'workflow_dispatch', 'release']
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: github.repository == 'nabeelio/phpvms'
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.3', '7.4']
|
||||||
|
name: PHP ${{ matrix.php-versions }}
|
||||||
|
env:
|
||||||
|
extensions: intl, pcov, mbstring
|
||||||
|
key: cache-v1
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Configure Caching
|
||||||
|
- name: Setup cache environment
|
||||||
|
id: cache-env
|
||||||
|
uses: shivammathur/cache-extensions@v1
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: ${{ env.extensions }}
|
||||||
|
key: ${{ env.key }}
|
||||||
|
|
||||||
|
- name: Cache extensions
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ steps.cache-env.outputs.dir }}
|
||||||
|
key: ${{ steps.cache-env.outputs.key }}
|
||||||
|
restore-keys: ${{ steps.cache-env.outputs.key }}
|
||||||
|
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
# Configure PHP
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: ${{ env.extensions }}
|
||||||
|
ini-values: post_max_size=256M, short_open_tag=On
|
||||||
|
coverage: xdebug
|
||||||
|
tools: php-cs-fixer, phpunit
|
||||||
|
|
||||||
|
- name: Shutdown Ubuntu MySQL
|
||||||
|
run: sudo service mysql stop
|
||||||
|
|
||||||
|
- name: Install MariaDB
|
||||||
|
uses: getong/mariadb-action@v1.1
|
||||||
|
with:
|
||||||
|
character set server: 'utf8'
|
||||||
|
collation server: 'utf8_general_ci'
|
||||||
|
mysql database: 'phpvms'
|
||||||
|
mysql root password: ''
|
||||||
|
mysql user: ''
|
||||||
|
mysql password: ''
|
||||||
|
|
||||||
|
- name: Configure Environment
|
||||||
|
run: |
|
||||||
|
php --version
|
||||||
|
mysql --version
|
||||||
|
# Downgrade composer version to 1.x
|
||||||
|
composer self-update --1
|
||||||
|
composer install --dev --no-interaction --verbose
|
||||||
|
cp .github/scripts/env.php env.php
|
||||||
|
cp .github/scripts/phpunit.xml phpunit.xml
|
||||||
|
php artisan database:create --reset
|
||||||
|
php artisan migrate:refresh --seed
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
|
||||||
|
vendor/bin/phpunit --debug --verbose
|
||||||
|
|
||||||
|
# This runs after all of the tests, run have run. Creates a cleaned up version of the
|
||||||
|
# distro, and then creates the artifact to push up to S3 or wherever
|
||||||
|
artifacts:
|
||||||
|
name: 'Create dev build'
|
||||||
|
needs: build
|
||||||
|
runs-on: 'ubuntu-18.04'
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
|
||||||
|
- uses: olegtarasov/get-tag@v2.1
|
||||||
|
id: tagName
|
||||||
|
|
||||||
|
# Configure Caching
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
- name: 'Install Release Dependencies'
|
||||||
|
run: |
|
||||||
|
rm -rf vendor
|
||||||
|
sudo npm i tar-to-zip -g
|
||||||
|
composer self-update --1
|
||||||
|
composer install --no-dev --prefer-dist --no-interaction --verbose
|
||||||
|
sudo chmod +x ./.github/scripts/*
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
run: .github/scripts/version.sh
|
||||||
|
|
||||||
|
- name: Build Distro
|
||||||
|
run: .github/scripts/build.sh
|
||||||
|
|
||||||
|
- name: Upload S3
|
||||||
|
uses: shallwefootball/s3-upload-action@v1.1.3
|
||||||
|
with:
|
||||||
|
aws_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
|
||||||
|
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY}}
|
||||||
|
aws_bucket: ${{ secrets.S3_BUCKET_NAME }}
|
||||||
|
source_dir: 'dist'
|
||||||
|
destination_dir: ''
|
||||||
|
|
||||||
|
- name: Discord notification
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.3.0
|
||||||
|
with:
|
||||||
|
# DISCORD_MSG is defined in versions.sh
|
||||||
|
args: '{{ DISCORD_MSG }}'
|
||||||
|
|
||||||
|
# This runs after all of the tests, run have run. Creates a cleaned up version of the
|
||||||
|
# distro, and then creates the artifact to push up to S3 or wherever
|
||||||
|
# https://github.com/actions/create-release
|
||||||
|
release:
|
||||||
|
name: 'Create Release'
|
||||||
|
needs: build
|
||||||
|
runs-on: 'ubuntu-18.04'
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
|
||||||
|
- uses: olegtarasov/get-tag@v2.1
|
||||||
|
id: tagName
|
||||||
|
|
||||||
|
# Configure Caching
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composer-cache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
- name: 'Install Release Dependencies'
|
||||||
|
run: |
|
||||||
|
rm -rf vendor
|
||||||
|
sudo npm i tar-to-zip -g
|
||||||
|
composer self-update --1
|
||||||
|
composer install --no-dev --prefer-dist --no-interaction --verbose
|
||||||
|
sudo chmod +x ./.github/scripts/*
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
run: .github/scripts/version.sh
|
||||||
|
|
||||||
|
- name: Build Distro
|
||||||
|
run: .github/scripts/build.sh
|
||||||
|
|
||||||
|
- name: Upload S3
|
||||||
|
uses: shallwefootball/s3-upload-action@v1.1.3
|
||||||
|
with:
|
||||||
|
aws_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
|
||||||
|
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY}}
|
||||||
|
aws_bucket: ${{ secrets.S3_BUCKET_NAME }}
|
||||||
|
source_dir: 'dist'
|
||||||
|
destination_dir: ''
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
run: .github/scripts/version.sh
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
# Upload the tar file to the release
|
||||||
|
- name: Upload Tar Asset
|
||||||
|
id: upload-tar-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: dist/{{TAR_NAME}}
|
||||||
|
asset_name: '{{ TAR_NAME }}'
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
|
||||||
|
# upload the zip file to the release
|
||||||
|
- name: Upload Zip Asset
|
||||||
|
id: upload-zip-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: dist/{{ZIP_NAME}}
|
||||||
|
asset_name: '{{ ZIP_NAME }}'
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Discord notification
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.3.0
|
||||||
|
with:
|
||||||
|
# DISCORD_MSG is defined in versions.sh
|
||||||
|
args: '{{ DISCORD_MSG }}'
|
||||||
-160
@@ -1,160 +0,0 @@
|
|||||||
#
|
|
||||||
# Travis CI config file
|
|
||||||
#
|
|
||||||
|
|
||||||
language: php
|
|
||||||
php:
|
|
||||||
- '7.4'
|
|
||||||
- '7.3'
|
|
||||||
|
|
||||||
#env:
|
|
||||||
# - DB=mysql
|
|
||||||
# - DB=mariadb
|
|
||||||
|
|
||||||
cache:
|
|
||||||
# Cache lives for 10 min
|
|
||||||
# Default of 3m might not be long enough for all the runs
|
|
||||||
timeout: 600
|
|
||||||
directories:
|
|
||||||
- "$HOME/.composer/cache"
|
|
||||||
- "$HOME/.npm"
|
|
||||||
|
|
||||||
services:
|
|
||||||
- mysql
|
|
||||||
|
|
||||||
#addons:
|
|
||||||
# mariadb: '10.2'
|
|
||||||
|
|
||||||
install:
|
|
||||||
- php --version
|
|
||||||
- mysql --version
|
|
||||||
- composer install --dev --no-interaction --verbose
|
|
||||||
- npm i tar-to-zip -g
|
|
||||||
- cp .travis/env.travis.php env.php
|
|
||||||
- cp .travis/phpunit.travis.xml phpunit.xml
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- php artisan database:create --reset
|
|
||||||
- php artisan migrate:refresh --seed
|
|
||||||
|
|
||||||
script:
|
|
||||||
- vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --diff --using-cache=no
|
|
||||||
- vendor/bin/phpunit --debug --verbose
|
|
||||||
|
|
||||||
after_failure:
|
|
||||||
- cat storage/logs/*.log
|
|
||||||
|
|
||||||
# Refer to: https://github.com/doctrine/dbal/blob/master/.travis.yml#L39
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
# Different test stages
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.2 + MySQL 5.7
|
|
||||||
# php: 7.2
|
|
||||||
# env: DB=mysql
|
|
||||||
# services:
|
|
||||||
# - mysql
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.3 + MySQL 5.7
|
|
||||||
# php: 7.3
|
|
||||||
# env: DB=mysql
|
|
||||||
# services:
|
|
||||||
# - mysql
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.4 + MySQL 5.7
|
|
||||||
# php: 7.4
|
|
||||||
# env: DB=mysql
|
|
||||||
# services:
|
|
||||||
# - mysql
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.2 + MariaDB 10.1
|
|
||||||
# php: 7.2
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.1'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.3 + MariaDB 10.1
|
|
||||||
# php: 7.3
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.1'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.4 + MariaDB 10.1
|
|
||||||
# php: 7.4
|
|
||||||
# env: DB=mariadb MARIADB_VERSION=10.1
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.1'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.2 + MariaDB 10.2
|
|
||||||
# php: 7.2
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.2'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.3 + MariaDB 10.3
|
|
||||||
# php: 7.3
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.2'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.4 + MariaDB 10.2
|
|
||||||
# php: 7.4
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.2'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.2 + MariaDB 10.3
|
|
||||||
# php: 7.2
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.3'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.3 + MariaDB 10.3
|
|
||||||
# php: 7.3
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.3'
|
|
||||||
# - stage: Test
|
|
||||||
# name: PHP 7.4 + MariaDB 10.3
|
|
||||||
# php: 7.4
|
|
||||||
# env: DB=mariadb
|
|
||||||
# addons:
|
|
||||||
# mariadb: '10.3'
|
|
||||||
|
|
||||||
# Just packages up a release
|
|
||||||
- stage: package
|
|
||||||
script: skip
|
|
||||||
before_deploy:
|
|
||||||
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
|
|
||||||
|
|
||||||
# Configure the conditional deployment
|
|
||||||
# https://docs.travis-ci.com/user/deployment/#examples-of-conditional-deployment
|
|
||||||
deploy:
|
|
||||||
- provider: script
|
|
||||||
skip_cleanup: true
|
|
||||||
script: ./.travis/deploy_script.sh
|
|
||||||
on:
|
|
||||||
all_branches: true
|
|
||||||
repo: nabeelio/phpvms
|
|
||||||
php: '7.4'
|
|
||||||
tags: false
|
|
||||||
|
|
||||||
# RELEASE STAGE
|
|
||||||
# Only runs when there's a tag applied to this release (tag should be the version)
|
|
||||||
# This uses Github Releases and posts it there (provider: releases)
|
|
||||||
# https://docs.travis-ci.com/user/deployment/releases
|
|
||||||
- stage: release
|
|
||||||
script: skip
|
|
||||||
before_deploy:
|
|
||||||
- curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/6b10798/install | bash
|
|
||||||
- ./.travis/deploy_script.sh
|
|
||||||
deploy:
|
|
||||||
provider: releases
|
|
||||||
skip_cleanup: true
|
|
||||||
api_key: $GITHUB_TOKEN
|
|
||||||
file_glob: true
|
|
||||||
file: build/*
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
repo: nabeelio/phpvms
|
|
||||||
php: '7.4'
|
|
||||||
@@ -1,18 +1,15 @@
|
|||||||
# phpvms <sup>7</sup>
|
# phpVMS <sup>7</sup>
|
||||||
|
|
||||||
[](https://travis-ci.org/nabeelio/phpvms) [](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&utm_medium=referral&utm_content=nabeelio/phpvms&utm_campaign=Badge_Grade) [](https://packagist.org/packages/nabeel/phpvms)  [](https://packagist.org/packages/nabeel/phpvms)
|
[](https://github.com/nabeelio/phpvms/actions) [](https://www.codacy.com/app/nabeelio/phpvms?utm_source=github.com&utm_medium=referral&utm_content=nabeelio/phpvms&utm_campaign=Badge_Grade) [](https://packagist.org/packages/nabeel/phpvms)  [](https://packagist.org/packages/nabeel/phpvms)
|
||||||
|
|
||||||
The next phpvms version built on the laravel framework. work in progress. The latest documentation, with installation instructions is available
|
The next phpvms version built on the laravel framework. work in progress. The latest documentation, with installation instructions is available [on the phpVMS documentation](https://docs.phpvms.net/) page.
|
||||||
[on the phpVMS documentation](http://docs.phpvms.net/) page.
|
|
||||||
|
|
||||||
# installation
|
## Installation
|
||||||
|
|
||||||
A full distribution, with all of the composer dependencies, is available at this
|
A full distribution, with all of the composer dependencies, is available at this
|
||||||
[GitHub Releases](https://github.com/nabeelio/phpvms/releases) link.
|
[GitHub Releases](https://github.com/nabeelio/phpvms/releases) link.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- PHP 7.3+, extensions:
|
- PHP 7.3+, extensions:
|
||||||
- cURL
|
- cURL
|
||||||
@@ -24,16 +21,16 @@ A full distribution, with all of the composer dependencies, is available at this
|
|||||||
- Database:
|
- Database:
|
||||||
- MySQL 5.5+ (or MySQL variant, including MariaDB and Percona)
|
- MySQL 5.5+ (or MySQL variant, including MariaDB and Percona)
|
||||||
|
|
||||||
[View more details on requirements](http://docs.phpvms.net/setup/requirements)
|
[View more details on requirements](https://docs.phpvms.net/requirements)
|
||||||
|
|
||||||
## Installer
|
### Installer
|
||||||
|
|
||||||
1. Upload to your server
|
1. Upload to your server
|
||||||
1. Visit the site, and follow the link to the installer
|
1. Visit the site, and follow the link to the installer
|
||||||
|
|
||||||
[View installation details](http://docs.phpvms.net/setup/installation)
|
[View installation details](https://docs.phpvms.net/installation/installation)
|
||||||
|
|
||||||
# development environment
|
## Development Environment
|
||||||
|
|
||||||
A full development environment can be brought up using Docker:
|
A full development environment can be brought up using Docker:
|
||||||
|
|
||||||
@@ -50,7 +47,7 @@ Then go to `http://localhost`. If you're using dnsmasq, the `app` container is l
|
|||||||
127.0.0.1 phpvms.test
|
127.0.0.1 phpvms.test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building JS/CSS assets
|
### Building JS/CSS assets
|
||||||
|
|
||||||
Yarn is required, run:
|
Yarn is required, run:
|
||||||
|
|
||||||
|
|||||||
@@ -92,8 +92,9 @@ class CreateDatabase extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->option('reset') === true) {
|
if ($this->option('reset') === true) {
|
||||||
$cmd = ['rm', '-rf', config($dbkey.'database')];
|
if (file_exists($dbPath)) {
|
||||||
$this->runCommand($cmd);
|
unlink(config($dbkey.'database'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($dbPath)) {
|
if (!file_exists($dbPath)) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Contracts\Command;
|
use App\Contracts\Command;
|
||||||
use Modules\Installer\Services\ConfigService;
|
use App\Services\Installer\ConfigService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a fresh development install
|
* Create a fresh development install
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\Importer\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Contracts\Command;
|
use App\Contracts\Command;
|
||||||
|
use App\Services\ImporterService;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Modules\Importer\Services\ImporterService;
|
|
||||||
|
|
||||||
class ImportFromClassicCommand extends Command
|
class ImportFromClassicCommand extends Command
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Contracts\Command;
|
use App\Contracts\Command;
|
||||||
use DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,6 +25,20 @@ class YamlExport extends Command
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A "preset" for exporting the base set of data
|
||||||
|
if ($tables[0] === 'base') {
|
||||||
|
$tables = [
|
||||||
|
'airlines',
|
||||||
|
'aircraft',
|
||||||
|
'subfleets',
|
||||||
|
'subfleet_fare',
|
||||||
|
'subfleet_rank',
|
||||||
|
'bids',
|
||||||
|
'fares',
|
||||||
|
'flights',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
$export_tables = [];
|
$export_tables = [];
|
||||||
foreach ($tables as $table) {
|
foreach ($tables as $table) {
|
||||||
$export_tables[$table] = [];
|
$export_tables[$table] = [];
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ abstract class Award
|
|||||||
* You don't really need to mess with anything below here
|
* You don't really need to mess with anything below here
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @var \App\Models\Award|null */
|
||||||
protected $award;
|
protected $award;
|
||||||
|
|
||||||
|
/** @var \App\Models\User|null */
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
public function __construct(AwardModel $award = null, User $user = null)
|
public function __construct(AwardModel $award = null, User $user = null)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Contracts;
|
namespace App\Contracts;
|
||||||
|
|
||||||
use App\Models\Airline;
|
use App\Models\Airline;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Log;
|
|
||||||
use Validator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common functionality used across all of the importers
|
* Common functionality used across all of the importers
|
||||||
@@ -51,9 +51,9 @@ class ImportExport
|
|||||||
*
|
*
|
||||||
* @param $code
|
* @param $code
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Model
|
* @return Airline
|
||||||
*/
|
*/
|
||||||
public function getAirline($code)
|
public function getAirline($code): Airline
|
||||||
{
|
{
|
||||||
$airline = Airline::firstOrCreate([
|
$airline = Airline::firstOrCreate([
|
||||||
'icao' => $code,
|
'icao' => $code,
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
namespace App\Contracts;
|
namespace App\Contracts;
|
||||||
|
|
||||||
use App\Support\Database;
|
use App\Support\Database;
|
||||||
use DB;
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Migration
|
* Class Migration
|
||||||
@@ -25,6 +28,29 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a module and enable it
|
||||||
|
*
|
||||||
|
* @param array $attrs
|
||||||
|
*/
|
||||||
|
public function addModule(array $attrs)
|
||||||
|
{
|
||||||
|
$module = array_merge([
|
||||||
|
'enabled' => true,
|
||||||
|
'created_at' => DB::raw('NOW()'),
|
||||||
|
'updated_at' => DB::raw('NOW()'),
|
||||||
|
], $attrs);
|
||||||
|
|
||||||
|
try {
|
||||||
|
DB::table('modules')->insert($module);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// setting already exists, just ignore it
|
||||||
|
if ($e->getCode() === 23000) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Seed a YAML file into the database
|
* Seed a YAML file into the database
|
||||||
*
|
*
|
||||||
@@ -35,7 +61,7 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
|
|||||||
try {
|
try {
|
||||||
$path = base_path($file);
|
$path = base_path($file);
|
||||||
Database::seed_from_yaml_file($path, false);
|
Database::seed_from_yaml_file($path, false);
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error('Unable to load '.$file.' file');
|
Log::error('Unable to load '.$file.' file');
|
||||||
Log::error($e);
|
Log::error($e);
|
||||||
}
|
}
|
||||||
@@ -52,7 +78,7 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
|
|||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
try {
|
try {
|
||||||
DB::table($table)->insert($row);
|
DB::table($table)->insert($row);
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
// setting already exists, just ignore it
|
// setting already exists, just ignore it
|
||||||
if ($e->getCode() === 23000) {
|
if ($e->getCode() === 23000) {
|
||||||
continue;
|
continue;
|
||||||
@@ -60,4 +86,22 @@ abstract class Migration extends \Illuminate\Database\Migrations\Migration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an award from the migrations (for example, if you're adding an award module)
|
||||||
|
*
|
||||||
|
* @param array $award See \App\Models\Awardv
|
||||||
|
*
|
||||||
|
* @throws \Illuminate\Validation\ValidationException
|
||||||
|
*/
|
||||||
|
public function addAward(array $award)
|
||||||
|
{
|
||||||
|
$validator = Validator::make($award, \App\Models\Award::$rules);
|
||||||
|
if ($validator->fails()) {
|
||||||
|
throw new ValidationException($validator);
|
||||||
|
}
|
||||||
|
|
||||||
|
$awardModel = new \App\Models\Award($award);
|
||||||
|
$awardModel->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Contracts\Modules;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for module service providers
|
||||||
|
* Add-on module service providers must extend this class. Docs on Service Providers:
|
||||||
|
* https://laravel.com/docs/7.x/providers
|
||||||
|
*
|
||||||
|
* For a sample service provider, view the sample module one:
|
||||||
|
* https://github.com/nabeelio/phpvms-module/blob/master/Providers/SampleServiceProvider.php
|
||||||
|
*/
|
||||||
|
abstract class ServiceProvider extends \Illuminate\Support\ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* A boot method is required, even if it doesn't do anything.
|
||||||
|
* https://laravel.com/docs/7.x/providers#the-boot-method
|
||||||
|
*
|
||||||
|
* This is normally where you'd register the routes or other startup tasks for your module
|
||||||
|
*/
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is required to register the links in either the public or admin toolbar
|
||||||
|
* For example, adding a frontend link:
|
||||||
|
*
|
||||||
|
* $this->moduleSvc->addFrontendLink('Sample', '/sample', '', $logged_in=true);
|
||||||
|
*
|
||||||
|
* Or an admin link:
|
||||||
|
*
|
||||||
|
* $this->moduleSvc->addAdminLink('Sample', '/admin/sample');
|
||||||
|
*/
|
||||||
|
public function registerLinks(): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deferred providers:
|
||||||
|
* https://laravel.com/docs/7.x/providers#deferred-providers
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function provides(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,11 +5,6 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
class RolesPermissionsTables extends Migration
|
class RolesPermissionsTables extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
// Create table for storing roles
|
// Create table for storing roles
|
||||||
@@ -79,11 +74,6 @@ class RolesPermissionsTables extends Migration
|
|||||||
$this->addData('roles', $roles);
|
$this->addData('roles', $roles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('permission_user');
|
Schema::dropIfExists('permission_user');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreatePasswordResetsTable extends Migration
|
class CreatePasswordResetsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('password_resets', function (Blueprint $table) {
|
Schema::create('password_resets', function (Blueprint $table) {
|
||||||
@@ -20,11 +15,6 @@ class CreatePasswordResetsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('password_resets');
|
Schema::dropIfExists('password_resets');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateSessionsTable extends Migration
|
class CreateSessionsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('sessions', function (Blueprint $table) {
|
Schema::create('sessions', function (Blueprint $table) {
|
||||||
@@ -23,11 +18,6 @@ class CreateSessionsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('sessions');
|
Schema::dropIfExists('sessions');
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
class CreateAirlinesTable extends Migration
|
class CreateAirlinesTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('airlines', function (Blueprint $table) {
|
Schema::create('airlines', function (Blueprint $table) {
|
||||||
@@ -32,11 +27,6 @@ class CreateAirlinesTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('airlines');
|
Schema::dropIfExists('airlines');
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
class CreateFaresTable extends Migration
|
class CreateFaresTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('fares', function (Blueprint $table) {
|
Schema::create('fares', function (Blueprint $table) {
|
||||||
@@ -25,11 +20,6 @@ class CreateFaresTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('fares');
|
Schema::dropIfExists('fares');
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
class CreateFlightTables extends Migration
|
class CreateFlightTables extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('flights', function (Blueprint $table) {
|
Schema::create('flights', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
class CreateRanksTable extends Migration
|
class CreateRanksTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('ranks', function (Blueprint $table) {
|
Schema::create('ranks', function (Blueprint $table) {
|
||||||
@@ -30,11 +25,6 @@ class CreateRanksTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('ranks');
|
Schema::dropIfExists('ranks');
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
use App\Contracts\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
/**
|
|
||||||
* Class CreateSubfleetTables
|
|
||||||
*/
|
|
||||||
class CreateSubfleetTables extends Migration
|
class CreateSubfleetTables extends Migration
|
||||||
{
|
{
|
||||||
public function up()
|
public function up()
|
||||||
@@ -48,11 +45,6 @@ class CreateSubfleetTables extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('subfleets');
|
Schema::dropIfExists('subfleets');
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateBidsTable extends Migration
|
class CreateBidsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('bids', function (Blueprint $table) {
|
Schema::create('bids', function (Blueprint $table) {
|
||||||
@@ -25,11 +20,6 @@ class CreateBidsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('bids');
|
Schema::dropIfExists('bids');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateJobsTable extends Migration
|
class CreateJobsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('jobs', function (Blueprint $table) {
|
Schema::create('jobs', function (Blueprint $table) {
|
||||||
@@ -24,11 +19,6 @@ class CreateJobsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('jobs');
|
Schema::dropIfExists('jobs');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateFailedJobsTable extends Migration
|
class CreateFailedJobsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||||
@@ -23,11 +18,6 @@ class CreateFailedJobsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('failed_jobs');
|
Schema::dropIfExists('failed_jobs');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateNavdataTables extends Migration
|
class CreateNavdataTables extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -31,11 +26,6 @@ class CreateNavdataTables extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('navdata');
|
Schema::dropIfExists('navdata');
|
||||||
|
|||||||
@@ -7,11 +7,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateAcarsTables extends Migration
|
class CreateAcarsTables extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('acars', function (Blueprint $table) {
|
Schema::create('acars', function (Blueprint $table) {
|
||||||
@@ -44,11 +39,6 @@ class CreateAcarsTables extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('acars');
|
Schema::dropIfExists('acars');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateStatsTable extends Migration
|
class CreateStatsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('stats', function (Blueprint $table) {
|
Schema::create('stats', function (Blueprint $table) {
|
||||||
@@ -25,11 +20,6 @@ class CreateStatsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('stats');
|
Schema::dropIfExists('stats');
|
||||||
|
|||||||
@@ -17,11 +17,6 @@ class CreateNewsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::drop('news');
|
Schema::drop('news');
|
||||||
|
|||||||
@@ -3,14 +3,10 @@
|
|||||||
use App\Contracts\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Modules\Awards\Awards\PilotFlightAwards;
|
||||||
|
|
||||||
class CreateAwardsTable extends Migration
|
class CreateAwardsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('awards', function (Blueprint $table) {
|
Schema::create('awards', function (Blueprint $table) {
|
||||||
@@ -23,7 +19,6 @@ class CreateAwardsTable extends Migration
|
|||||||
// EG, the airports has an internal expense for gate costs
|
// EG, the airports has an internal expense for gate costs
|
||||||
$table->string('ref_model')->nullable();
|
$table->string('ref_model')->nullable();
|
||||||
$table->text('ref_model_params')->nullable();
|
$table->text('ref_model_params')->nullable();
|
||||||
//$table->string('ref_model_id', 36)->nullable();
|
|
||||||
|
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
@@ -38,13 +33,20 @@ class CreateAwardsTable extends Migration
|
|||||||
|
|
||||||
$table->index(['user_id', 'award_id']);
|
$table->index(['user_id', 'award_id']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a default, sample award
|
||||||
|
*/
|
||||||
|
$award = [
|
||||||
|
'name' => 'Pilot 50 flights',
|
||||||
|
'description' => 'When a pilot has 50 flights, give this award',
|
||||||
|
'ref_model' => PilotFlightAwards::class,
|
||||||
|
'ref_model_params' => 50,
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->addAward($award);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('awards');
|
Schema::dropIfExists('awards');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateJournalTransactionsTable extends Migration
|
class CreateJournalTransactionsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('journal_transactions', function (Blueprint $table) {
|
Schema::create('journal_transactions', function (Blueprint $table) {
|
||||||
@@ -34,11 +29,6 @@ class CreateJournalTransactionsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('journal_transactions');
|
Schema::dropIfExists('journal_transactions');
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
|
|
||||||
class CreateJournalsTable extends Migration
|
class CreateJournalsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('journals', function (Blueprint $table) {
|
Schema::create('journals', function (Blueprint $table) {
|
||||||
@@ -24,11 +19,6 @@ class CreateJournalsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('journals');
|
Schema::dropIfExists('journals');
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Contracts\Migration;
|
use App\Contracts\Migration;
|
||||||
|
use App\Contracts\Model;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ class CreateFilesTable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('files', function (Blueprint $table) {
|
Schema::create('files', function (Blueprint $table) {
|
||||||
$table->string('id', \App\Contracts\Model::ID_MAX_LENGTH);
|
$table->string('id', Model::ID_MAX_LENGTH);
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('description')->nullable();
|
$table->string('description')->nullable();
|
||||||
$table->string('disk')->nullable();
|
$table->string('disk')->nullable();
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddReadonlyToRoles extends Migration
|
class AddReadonlyToRoles extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('roles', static function (Blueprint $table) {
|
Schema::table('roles', static function (Blueprint $table) {
|
||||||
@@ -24,11 +19,6 @@ class AddReadonlyToRoles extends Migration
|
|||||||
->update(['read_only' => true]);
|
->update(['read_only' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::table('roles', static function (Blueprint $table) {
|
Schema::table('roles', static function (Blueprint $table) {
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kinda of gross operations to change the pilot ID column
|
||||||
|
* 1. Add an `pilot_id` column, which will get populated with the current ID
|
||||||
|
* 2. Drop the `id` column, and then recreate it as a string field
|
||||||
|
* 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
|
class UsersAddPilotId extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Kinda of gross operations to change the pilot ID column
|
|
||||||
* 1. Add an `pilot_id` column, which will get populated with the current ID
|
|
||||||
* 2. Drop the `id` column, and then recreate it as a string field
|
|
||||||
* 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`
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('users', static function (Blueprint $table) {
|
Schema::table('users', static function (Blueprint $table) {
|
||||||
@@ -29,11 +27,6 @@ class UsersAddPilotId extends Migration
|
|||||||
DB::table('users')->update(['pilot_id' => DB::raw('`id`')]);
|
DB::table('users')->update(['pilot_id' => DB::raw('`id`')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateNotificationsTable extends Migration
|
class CreateNotificationsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('notifications', function (Blueprint $table) {
|
Schema::create('notifications', function (Blueprint $table) {
|
||||||
@@ -23,11 +18,6 @@ class CreateNotificationsTable extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('notifications');
|
Schema::dropIfExists('notifications');
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Contracts\Migration;
|
||||||
use App\Models\Enums\PirepState;
|
use App\Models\Enums\PirepState;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the PIREP state column to be a TINYINT
|
||||||
|
*/
|
||||||
class PirepsChangeStateType extends Migration
|
class PirepsChangeStateType extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Change the PIREP state column to be a TINYINT
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
// Migrate the old rejected state
|
// Migrate the old rejected state
|
||||||
@@ -25,13 +23,4 @@ class PirepsChangeStateType extends Migration
|
|||||||
$table->unsignedSmallInteger('state')->change();
|
$table->unsignedSmallInteger('state')->change();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,27 +5,15 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a `flight_id` column to the PIREPs table
|
||||||
|
*/
|
||||||
class PirepsAddFlightId extends Migration
|
class PirepsAddFlightId extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Add a `flight_id` column to the PIREPs table
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('pireps', function (Blueprint $table) {
|
Schema::table('pireps', function (Blueprint $table) {
|
||||||
$table->string('flight_id', Model::ID_MAX_LENGTH)->nullable()->after('aircraft_id');
|
$table->string('flight_id', Model::ID_MAX_LENGTH)->nullable()->after('aircraft_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('pireps', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('flight_id');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a `flight_type` column to the expenses table
|
||||||
|
*/
|
||||||
class ExpensesAddFlightType extends Migration
|
class ExpensesAddFlightType extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Add a `flight_type` column to the expenses table
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('expenses', function (Blueprint $table) {
|
Schema::table('expenses', function (Blueprint $table) {
|
||||||
@@ -18,11 +18,6 @@ class ExpensesAddFlightType extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('expenses', function (Blueprint $table) {
|
Schema::table('expenses', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,13 +25,4 @@ class ModifyAirportsCoordinates extends Migration
|
|||||||
$table->decimal('lon', 11, 5)->change()->default(0.0)->nullable();
|
$table->decimal('lon', 11, 5)->change()->default(0.0)->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -8,24 +8,10 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
*/
|
*/
|
||||||
class FlightFieldNullable extends Migration
|
class FlightFieldNullable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('flight_field_values', function ($table) {
|
Schema::table('flight_field_values', function ($table) {
|
||||||
$table->text('value')->change()->nullable();
|
$table->text('value')->change()->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a `load_factor` and `load_factor_variance` columns to the expenses table
|
||||||
|
*/
|
||||||
class FlightsAddLoadFactor extends Migration
|
class FlightsAddLoadFactor extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Add a `load_factor` and `load_factor_variance` columns to the expenses table
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('flights', function (Blueprint $table) {
|
Schema::table('flights', function (Blueprint $table) {
|
||||||
@@ -22,11 +22,6 @@ class FlightsAddLoadFactor extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('flights', function (Blueprint $table) {
|
Schema::table('flights', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
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
|
class FlightsAddPilotPay extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Add a `pilot_pay` column for a fixed amount to pay to a pilot for a flight
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('flights', function (Blueprint $table) {
|
Schema::table('flights', function (Blueprint $table) {
|
||||||
@@ -18,11 +18,6 @@ class FlightsAddPilotPay extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('flights', function (Blueprint $table) {
|
Schema::table('flights', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Contracts\Migration;
|
||||||
use App\Models\Enums\FareType;
|
use App\Models\Enums\FareType;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
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
|
class FaresAddType extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Add a `pilot_pay` column for a fixed amount to pay to a pilot for a flight
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('fares', function (Blueprint $table) {
|
Schema::table('fares', function (Blueprint $table) {
|
||||||
@@ -19,16 +19,4 @@ class FaresAddType extends Migration
|
|||||||
->after('capacity');
|
->after('capacity');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('fares', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('type');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -33,13 +33,4 @@ class IncreaseIdLengths extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -15,13 +15,4 @@ class RemoveSubfleetTypeIndex extends Migration
|
|||||||
$table->dropUnique(['type']);
|
$table->dropUnique(['type']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Contracts\Migration;
|
||||||
use App\Models\Enums\PageType;
|
use App\Models\Enums\PageType;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -11,11 +11,6 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
*/
|
*/
|
||||||
class CreatePages extends Migration
|
class CreatePages extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('pages', function (Blueprint $table) {
|
Schema::create('pages', function (Blueprint $table) {
|
||||||
@@ -33,11 +28,6 @@ class CreatePages extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('pages');
|
Schema::dropIfExists('pages');
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -9,11 +9,7 @@ class AirlineRemoveNullable extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('airlines', function (Blueprint $table) {
|
Schema::table('airlines', function (Blueprint $table) {
|
||||||
$table->dropUnique('airlines_iata_unique');
|
$table->dropUnique(['iata']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -12,8 +12,4 @@ class PageIconNullable extends Migration
|
|||||||
$table->string('icon')->change()->nullable();
|
$table->string('icon')->change()->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
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
|
class PagesAddLink extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('pages', function (Blueprint $table) {
|
Schema::table('pages', function (Blueprint $table) {
|
||||||
@@ -23,9 +23,6 @@ class PagesAddLink extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('fares', function (Blueprint $table) {
|
Schema::table('fares', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add two tables for holding user fields and the values
|
||||||
|
*/
|
||||||
class CreateUserFields extends Migration
|
class CreateUserFields extends Migration
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Add two tables for holding user fields and the values
|
|
||||||
*/
|
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -39,11 +39,4 @@ class CreateUserFields extends Migration
|
|||||||
$table->index(['user_field_id', 'user_id']);
|
$table->index(['user_field_id', 'user_id']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use App\Contracts\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
@@ -19,11 +19,6 @@ class AircraftAddMtow extends Migration
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('aircraft', function (Blueprint $table) {
|
Schema::table('aircraft', function (Blueprint $table) {
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Contracts\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateModulesTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('modules', function (Blueprint $table) {
|
||||||
|
$table->increments('id');
|
||||||
|
$table->string('name');
|
||||||
|
$table->boolean('enabled')->default(1);
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->addModule(['name' => 'Awards']);
|
||||||
|
$this->addModule(['name' => 'Sample']);
|
||||||
|
$this->addModule(['name' => 'VMSAcars']);
|
||||||
|
$this->addModule(['name' => 'Vacentral']);
|
||||||
|
$this->addModule(['name' => 'TestModule']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('modules');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the pages body column type to a Medium Text, max size of 16MB
|
||||||
|
*/
|
||||||
|
class ModifyPagesSize extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('pages', function (Blueprint $table) {
|
||||||
|
$table->mediumText('body')->change()->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Contracts\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the downloads link size
|
||||||
|
*/
|
||||||
|
class ModifyDownloadLinkSize extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('files', function (Blueprint $table) {
|
||||||
|
$table->mediumText('disk')->change()->nullable();
|
||||||
|
$table->mediumText('path')->change()->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Contracts\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a hub to the subfleet is
|
||||||
|
*/
|
||||||
|
class AddHubToSubfleets extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('subfleets', function (Blueprint $table) {
|
||||||
|
$table->string('hub_id', 4)
|
||||||
|
->nullable()
|
||||||
|
->after('airline_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Services\Installer\MigrationService;
|
||||||
use App\Services\Installer\SeederService;
|
use App\Services\Installer\SeederService;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
||||||
{
|
{
|
||||||
private $seederService;
|
/** @var MigrationService */
|
||||||
|
private $migrationSvc;
|
||||||
|
|
||||||
|
/** @var SeederService */
|
||||||
|
private $seederSvc;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->seederService = app(SeederService::class);
|
$this->migrationSvc = app(MigrationService::class);
|
||||||
|
$this->seederSvc = app(SeederService::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,6 +25,12 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$this->seederService->syncAllSeeds();
|
// Make sure any migrations that need to be run are run/cleared out
|
||||||
|
if ($this->migrationSvc->migrationsAvailable()) {
|
||||||
|
$this->migrationSvc->runAllMigrations();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then sync all of the seeds
|
||||||
|
$this->seederSvc->syncAllSeeds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
local.yml
|
local.yml
|
||||||
|
vmsacars.yml
|
||||||
|
|||||||
@@ -1,30 +1,10 @@
|
|||||||
|
|
||||||
#airlines:
|
|
||||||
# - id: 1
|
|
||||||
# icao: VMS
|
|
||||||
# iata: VM
|
|
||||||
# name: phpvms airlines
|
|
||||||
# country: us
|
|
||||||
# active: 1
|
|
||||||
# created_at: now
|
|
||||||
# updated_at: now
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
id_column: name
|
id_column: name
|
||||||
data:
|
data:
|
||||||
- name: fleet-only
|
- name: fleet-only
|
||||||
display_name: Edit Fleet
|
display_name: Edit Fleet
|
||||||
|
|
||||||
awards:
|
|
||||||
- id: 1
|
|
||||||
name: Pilot 50 flights
|
|
||||||
description: When a pilot has 50 flights, give this award
|
|
||||||
image_url:
|
|
||||||
ref_model: Modules\Awards\Awards\PilotFlightAwards
|
|
||||||
ref_model_params: 50
|
|
||||||
created_at: now
|
|
||||||
updated_at: now
|
|
||||||
|
|
||||||
news:
|
news:
|
||||||
- id: 1
|
- id: 1
|
||||||
user_id: 1
|
user_id: 1
|
||||||
@@ -136,34 +116,91 @@ airports:
|
|||||||
ground_handling_cost: 50
|
ground_handling_cost: 50
|
||||||
#
|
#
|
||||||
aircraft:
|
aircraft:
|
||||||
- id: 1
|
-
|
||||||
|
id: 1
|
||||||
subfleet_id: 1
|
subfleet_id: 1
|
||||||
|
icao: null
|
||||||
|
iata: null
|
||||||
airport_id: KJFK
|
airport_id: KJFK
|
||||||
name: Boeing 747-438
|
landing_time: '2020-10-23 07:50:16'
|
||||||
|
name: 'Boeing 747-438'
|
||||||
registration: 001Z
|
registration: 001Z
|
||||||
flight_time: 360
|
hex_code: null
|
||||||
|
mtow: '0.00'
|
||||||
|
zfw: '0.00'
|
||||||
|
flight_time: 540
|
||||||
status: A
|
status: A
|
||||||
- id: 2
|
state: 0
|
||||||
|
created_at: null
|
||||||
|
updated_at: '2020-10-23 07:50:16'
|
||||||
|
-
|
||||||
|
id: 2
|
||||||
subfleet_id: 2
|
subfleet_id: 2
|
||||||
|
icao: null
|
||||||
|
iata: null
|
||||||
airport_id: LGRP
|
airport_id: LGRP
|
||||||
name: Boeing 777-200
|
landing_time: null
|
||||||
|
name: 'Boeing 777-200'
|
||||||
registration: C202
|
registration: C202
|
||||||
|
hex_code: null
|
||||||
|
mtow: '0.00'
|
||||||
|
zfw: '0.00'
|
||||||
flight_time: 260
|
flight_time: 260
|
||||||
status: A
|
status: A
|
||||||
- id: 3
|
state: 0
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 3
|
||||||
subfleet_id: 1
|
subfleet_id: 1
|
||||||
|
icao: null
|
||||||
|
iata: null
|
||||||
airport_id: KAUS
|
airport_id: KAUS
|
||||||
name: Boeing 747-412
|
landing_time: '2020-10-24 08:50:13'
|
||||||
|
name: 'Boeing 747-412'
|
||||||
registration: S2333
|
registration: S2333
|
||||||
flight_time: 0
|
hex_code: null
|
||||||
|
mtow: '0.00'
|
||||||
|
zfw: '0.00'
|
||||||
|
flight_time: 180
|
||||||
status: A
|
status: A
|
||||||
- id: 4
|
state: 0
|
||||||
|
created_at: null
|
||||||
|
updated_at: '2020-10-24 08:50:13'
|
||||||
|
-
|
||||||
|
id: 4
|
||||||
subfleet_id: 1
|
subfleet_id: 1
|
||||||
|
icao: null
|
||||||
|
iata: null
|
||||||
airport_id: KAUS
|
airport_id: KAUS
|
||||||
name: Boeing 747-436 RETIRED
|
landing_time: null
|
||||||
registration:
|
name: 'Boeing 747-436 RETIRED'
|
||||||
|
registration: null
|
||||||
|
hex_code: null
|
||||||
|
mtow: '0.00'
|
||||||
|
zfw: '0.00'
|
||||||
flight_time: 45
|
flight_time: 45
|
||||||
status: R
|
status: R
|
||||||
|
state: 0
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 5
|
||||||
|
subfleet_id: 4
|
||||||
|
icao: A320
|
||||||
|
iata: '320'
|
||||||
|
airport_id: EGLL
|
||||||
|
landing_time: null
|
||||||
|
name: 'Airbus A320'
|
||||||
|
registration: N786DL
|
||||||
|
hex_code: b47165dd
|
||||||
|
mtow: '78800.00'
|
||||||
|
zfw: '62500.00'
|
||||||
|
flight_time: 0
|
||||||
|
status: A
|
||||||
|
state: 0
|
||||||
|
created_at: '2020-10-22 13:38:50'
|
||||||
|
updated_at: '2020-10-22 13:38:50'
|
||||||
|
|
||||||
expenses:
|
expenses:
|
||||||
- name: Per-Flight (no muliplier)
|
- name: Per-Flight (no muliplier)
|
||||||
@@ -220,68 +257,192 @@ expenses:
|
|||||||
updated_at: now
|
updated_at: now
|
||||||
|
|
||||||
fares:
|
fares:
|
||||||
- id: 1
|
-
|
||||||
code: Y
|
id: 1
|
||||||
|
code: 'Y'
|
||||||
name: Economy
|
name: Economy
|
||||||
price: 100
|
price: '100.00'
|
||||||
|
cost: '0.00'
|
||||||
capacity: 200
|
capacity: 200
|
||||||
- id: 2
|
type: 0
|
||||||
|
notes: null
|
||||||
|
active: 1
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 2
|
||||||
code: B
|
code: B
|
||||||
name: Business
|
name: Business
|
||||||
price: 500
|
price: '500.00'
|
||||||
|
cost: '0.00'
|
||||||
capacity: 10
|
capacity: 10
|
||||||
- id: 3
|
type: 0
|
||||||
|
notes: null
|
||||||
|
active: 1
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 3
|
||||||
code: F
|
code: F
|
||||||
name: First-Class
|
name: First-Class
|
||||||
price: 800
|
price: '800.00'
|
||||||
|
cost: '0.00'
|
||||||
capacity: 5
|
capacity: 5
|
||||||
|
type: 0
|
||||||
|
notes: null
|
||||||
|
active: 1
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
|
||||||
subfleets:
|
subfleets:
|
||||||
- id: 1
|
-
|
||||||
|
id: 1
|
||||||
airline_id: 1
|
airline_id: 1
|
||||||
name: 747-43X RB211-524G
|
|
||||||
type: 744-3X-RB211
|
type: 744-3X-RB211
|
||||||
cost_block_hour: 1000
|
name: '747-43X RB211-524G'
|
||||||
ground_handling_multiplier: 200
|
cost_block_hour: '1000.00'
|
||||||
- id: 2
|
cost_delay_minute: '0.00'
|
||||||
|
fuel_type: null
|
||||||
|
ground_handling_multiplier: '200.00'
|
||||||
|
cargo_capacity: null
|
||||||
|
fuel_capacity: null
|
||||||
|
gross_weight: null
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 2
|
||||||
airline_id: 1
|
airline_id: 1
|
||||||
name: 777-222ER GE90-76B
|
|
||||||
type: 772-22ER-GE90-76B
|
type: 772-22ER-GE90-76B
|
||||||
cost_block_hour: 500
|
name: '777-222ER GE90-76B'
|
||||||
ground_handling_multiplier: 150
|
cost_block_hour: '500.00'
|
||||||
- id: 3
|
cost_delay_minute: '0.00'
|
||||||
|
fuel_type: null
|
||||||
|
ground_handling_multiplier: '150.00'
|
||||||
|
cargo_capacity: null
|
||||||
|
fuel_capacity: null
|
||||||
|
gross_weight: null
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 3
|
||||||
airline_id: 1
|
airline_id: 1
|
||||||
name: 777-367 ER GE90-115B
|
|
||||||
type: 772-36ER-GE90-115B
|
type: 772-36ER-GE90-115B
|
||||||
cost_block_hour: 100
|
name: '777-367 ER GE90-115B'
|
||||||
ground_handling_multiplier: 150
|
cost_block_hour: '100.00'
|
||||||
|
cost_delay_minute: '0.00'
|
||||||
|
fuel_type: null
|
||||||
|
ground_handling_multiplier: '150.00'
|
||||||
|
cargo_capacity: null
|
||||||
|
fuel_capacity: null
|
||||||
|
gross_weight: null
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
id: 4
|
||||||
|
airline_id: 1
|
||||||
|
type: A320
|
||||||
|
name: A320
|
||||||
|
cost_block_hour: '2300.00'
|
||||||
|
cost_delay_minute: null
|
||||||
|
fuel_type: 1
|
||||||
|
ground_handling_multiplier: '100.00'
|
||||||
|
cargo_capacity: null
|
||||||
|
fuel_capacity: null
|
||||||
|
gross_weight: null
|
||||||
|
created_at: '2020-10-22 13:36:49'
|
||||||
|
updated_at: '2020-10-22 13:36:49'
|
||||||
|
|
||||||
# add a few mods to aircraft and fares
|
|
||||||
subfleet_fare:
|
subfleet_fare:
|
||||||
|
-
|
||||||
# Fare classes on the 747
|
subfleet_id: 1
|
||||||
- subfleet_id: 1
|
|
||||||
fare_id: 1
|
fare_id: 1
|
||||||
price: 200
|
price: '200'
|
||||||
capacity: 400
|
cost: null
|
||||||
- subfleet_id: 1
|
capacity: '400'
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
subfleet_id: 1
|
||||||
fare_id: 2
|
fare_id: 2
|
||||||
price: 120%
|
price: 120%
|
||||||
- subfleet_id: 1
|
cost: null
|
||||||
fare_id: 3
|
capacity: null
|
||||||
price: 1000
|
created_at: null
|
||||||
capacity: 110%
|
updated_at: null
|
||||||
|
-
|
||||||
# Fare classes on the 777
|
|
||||||
- subfleet_id: 2
|
|
||||||
fare_id: 1
|
|
||||||
- subfleet_id: 2
|
|
||||||
fare_id: 3
|
|
||||||
capacity: 10
|
|
||||||
|
|
||||||
subfleet_rank:
|
|
||||||
- rank_id: 1
|
|
||||||
subfleet_id: 1
|
subfleet_id: 1
|
||||||
|
fare_id: 3
|
||||||
|
price: '1000'
|
||||||
|
cost: null
|
||||||
|
capacity: 110%
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
subfleet_id: 2
|
||||||
|
fare_id: 1
|
||||||
|
price: null
|
||||||
|
cost: null
|
||||||
|
capacity: null
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
subfleet_id: 2
|
||||||
|
fare_id: 3
|
||||||
|
price: null
|
||||||
|
cost: null
|
||||||
|
capacity: '10'
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
subfleet_id: 4
|
||||||
|
fare_id: 1
|
||||||
|
price: null
|
||||||
|
cost: null
|
||||||
|
capacity: '123'
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
subfleet_id: 4
|
||||||
|
fare_id: 2
|
||||||
|
price: null
|
||||||
|
cost: null
|
||||||
|
capacity: '8'
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
-
|
||||||
|
subfleet_id: 4
|
||||||
|
fare_id: 3
|
||||||
|
price: null
|
||||||
|
cost: null
|
||||||
|
capacity: '2'
|
||||||
|
created_at: null
|
||||||
|
updated_at: null
|
||||||
|
subfleet_rank:
|
||||||
|
-
|
||||||
|
rank_id: 1
|
||||||
|
subfleet_id: 1
|
||||||
|
acars_pay: null
|
||||||
|
manual_pay: null
|
||||||
|
-
|
||||||
|
rank_id: 1
|
||||||
|
subfleet_id: 4
|
||||||
|
acars_pay: null
|
||||||
|
manual_pay: null
|
||||||
|
-
|
||||||
|
rank_id: 2
|
||||||
|
subfleet_id: 4
|
||||||
|
acars_pay: null
|
||||||
|
manual_pay: null
|
||||||
|
-
|
||||||
|
rank_id: 3
|
||||||
|
subfleet_id: 4
|
||||||
|
acars_pay: null
|
||||||
|
manual_pay: null
|
||||||
|
-
|
||||||
|
rank_id: 4
|
||||||
|
subfleet_id: 4
|
||||||
|
acars_pay: null
|
||||||
|
manual_pay: null
|
||||||
|
|
||||||
flights:
|
flights:
|
||||||
- id: flightid_1
|
- id: flightid_1
|
||||||
@@ -359,6 +520,35 @@ flights:
|
|||||||
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
route: 'MLY5 KEMBO UG442 SIA UG633 OTEKO UR640 NALRO GUBEL3'
|
||||||
created_at: NOW
|
created_at: NOW
|
||||||
updated_at: NOW
|
updated_at: NOW
|
||||||
|
-
|
||||||
|
id: q8mvZ5vdExoy0mQG
|
||||||
|
airline_id: 1
|
||||||
|
flight_number: 3003
|
||||||
|
route_code: null
|
||||||
|
route_leg: null
|
||||||
|
dpt_airport_id: KSEA
|
||||||
|
arr_airport_id: KPAE
|
||||||
|
alt_airport_id: null
|
||||||
|
dpt_time: '8:00'
|
||||||
|
arr_time: '8:45'
|
||||||
|
level: null
|
||||||
|
distance: '27.51'
|
||||||
|
flight_time: 45
|
||||||
|
flight_type: J
|
||||||
|
load_factor: null
|
||||||
|
load_factor_variance: null
|
||||||
|
route: null
|
||||||
|
pilot_pay: null
|
||||||
|
notes: null
|
||||||
|
scheduled: 0
|
||||||
|
days: null
|
||||||
|
start_date: null
|
||||||
|
end_date: null
|
||||||
|
has_bid: 1
|
||||||
|
active: 1
|
||||||
|
visible: 1
|
||||||
|
created_at: now
|
||||||
|
updated_at: now
|
||||||
|
|
||||||
flight_fields:
|
flight_fields:
|
||||||
- name: Departure Terminal
|
- name: Departure Terminal
|
||||||
@@ -389,12 +579,24 @@ flight_subfleet:
|
|||||||
flight_id: flightid_4
|
flight_id: flightid_4
|
||||||
|
|
||||||
bids:
|
bids:
|
||||||
- id: 100
|
-
|
||||||
|
id: 100
|
||||||
user_id: 1
|
user_id: 1
|
||||||
flight_id: flightid_1
|
flight_id: flightid_1
|
||||||
- id: 101
|
created_at: now
|
||||||
|
updated_at: now
|
||||||
|
-
|
||||||
|
id: 101
|
||||||
user_id: 1
|
user_id: 1
|
||||||
flight_id: flightid_3
|
flight_id: flightid_3
|
||||||
|
created_at: now
|
||||||
|
updated_at: now
|
||||||
|
-
|
||||||
|
id: 102
|
||||||
|
user_id: 1
|
||||||
|
flight_id: q8mvZ5vdExoy0mQG
|
||||||
|
created_at: now
|
||||||
|
updated_at: now
|
||||||
|
|
||||||
pireps:
|
pireps:
|
||||||
- id: pirepid_1
|
- id: pirepid_1
|
||||||
|
|||||||
@@ -92,3 +92,10 @@ user_field_values:
|
|||||||
user_field_id: 2
|
user_field_id: 2
|
||||||
user_id: 1
|
user_id: 1
|
||||||
value: 'Nobody did'
|
value: 'Nobody did'
|
||||||
|
|
||||||
|
user_awards:
|
||||||
|
- id: 1
|
||||||
|
user_id: 1
|
||||||
|
award_id: 1
|
||||||
|
created_at: now
|
||||||
|
updated_at: now
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
- name: 'Awards'
|
||||||
|
enabled: 1
|
||||||
|
- name: 'Sample'
|
||||||
|
enabled: 1
|
||||||
|
- name: 'VMSAcars'
|
||||||
|
enabled: 1
|
||||||
|
- name: 'Vacentral'
|
||||||
|
enabled: 1
|
||||||
|
- name: 'TestModule'
|
||||||
|
enabled: 1
|
||||||
@@ -51,3 +51,6 @@
|
|||||||
- name: maintenance
|
- name: maintenance
|
||||||
display_name: Maintenance
|
display_name: Maintenance
|
||||||
description: Run maintenance tasks
|
description: Run maintenance tasks
|
||||||
|
- name: modules
|
||||||
|
display_name: Modules
|
||||||
|
description: Add/Edit Modules
|
||||||
|
|||||||
@@ -130,6 +130,20 @@
|
|||||||
options: ''
|
options: ''
|
||||||
type: int
|
type: int
|
||||||
description: 'Initial zoom level on the map'
|
description: 'Initial zoom level on the map'
|
||||||
|
- key: airports.default_ground_handling_cost
|
||||||
|
name: 'Default Ground Handling Cost'
|
||||||
|
group: airports
|
||||||
|
value: 250
|
||||||
|
options:
|
||||||
|
type: int
|
||||||
|
description: If an airport's Ground Handling Cost Cost isn't added, set this value by default
|
||||||
|
- key: airports.default_jet_a_fuel_cost
|
||||||
|
name: 'Default Jet A Fuel Cost'
|
||||||
|
group: airports
|
||||||
|
value: 0.7
|
||||||
|
options:
|
||||||
|
type: text
|
||||||
|
description: If an airport's Jet A Fuel Cost isn't added, set this value by default
|
||||||
- key: bids.disable_flight_on_bid
|
- key: bids.disable_flight_on_bid
|
||||||
name: 'Disable flight on bid'
|
name: 'Disable flight on bid'
|
||||||
group: bids
|
group: bids
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class ValidationException extends AbstractHttpException
|
|||||||
|
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
400,
|
400,
|
||||||
'Validation exception'
|
'Validation Error'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
class ModuleExistsException extends AbstractHttpException
|
||||||
|
{
|
||||||
|
private $module_name;
|
||||||
|
|
||||||
|
public function __construct($module_name)
|
||||||
|
{
|
||||||
|
$this->module_name = $module_name;
|
||||||
|
parent::__construct(
|
||||||
|
409,
|
||||||
|
'Module '.$module_name.' Already Exists!'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the RFC 7807 error type (without the URL root)
|
||||||
|
*/
|
||||||
|
public function getErrorType(): string
|
||||||
|
{
|
||||||
|
return 'module-already-exists';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the detailed error string
|
||||||
|
*/
|
||||||
|
public function getErrorDetails(): string
|
||||||
|
{
|
||||||
|
return $this->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an array with the error details, merged with the RFC7807 response
|
||||||
|
*/
|
||||||
|
public function getErrorMetadata(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
class ModuleInstallationError extends AbstractHttpException
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct(
|
||||||
|
500,
|
||||||
|
'Installation of Module Failed!'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the RFC 7807 error type (without the URL root)
|
||||||
|
*/
|
||||||
|
public function getErrorType(): string
|
||||||
|
{
|
||||||
|
return 'module-installation-error';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the detailed error string
|
||||||
|
*/
|
||||||
|
public function getErrorDetails(): string
|
||||||
|
{
|
||||||
|
return $this->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an array with the error details, merged with the RFC7807 response
|
||||||
|
*/
|
||||||
|
public function getErrorMetadata(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exceptions;
|
||||||
|
|
||||||
|
class ModuleInvalidFileType extends AbstractHttpException
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct(
|
||||||
|
415,
|
||||||
|
'The Module File Type is Invalid!'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the RFC 7807 error type (without the URL root)
|
||||||
|
*/
|
||||||
|
public function getErrorType(): string
|
||||||
|
{
|
||||||
|
return 'module-file-type-invalid';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the detailed error string
|
||||||
|
*/
|
||||||
|
public function getErrorDetails(): string
|
||||||
|
{
|
||||||
|
return $this->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an array with the error details, merged with the RFC7807 response
|
||||||
|
*/
|
||||||
|
public function getErrorMetadata(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -160,6 +160,7 @@ class AircraftController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function update($id, UpdateAircraftRequest $request)
|
public function update($id, UpdateAircraftRequest $request)
|
||||||
{
|
{
|
||||||
|
/** @var \App\Models\Aircraft $aircraft */
|
||||||
$aircraft = $this->aircraftRepo->findWithoutFail($id);
|
$aircraft = $this->aircraftRepo->findWithoutFail($id);
|
||||||
|
|
||||||
if (empty($aircraft)) {
|
if (empty($aircraft)) {
|
||||||
@@ -171,7 +172,7 @@ class AircraftController extends Controller
|
|||||||
$this->aircraftRepo->update($attrs, $id);
|
$this->aircraftRepo->update($attrs, $id);
|
||||||
|
|
||||||
Flash::success('Aircraft updated successfully.');
|
Flash::success('Aircraft updated successfully.');
|
||||||
return redirect(route('admin.aircraft.index'));
|
return redirect(route('admin.aircraft.index').'?subfleet='.$aircraft->subfleet_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -183,6 +184,7 @@ class AircraftController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
|
/** @var \App\Models\Aircraft $aircraft */
|
||||||
$aircraft = $this->aircraftRepo->findWithoutFail($id);
|
$aircraft = $this->aircraftRepo->findWithoutFail($id);
|
||||||
|
|
||||||
if (empty($aircraft)) {
|
if (empty($aircraft)) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ use App\Repositories\FareRepository;
|
|||||||
use App\Services\ExportService;
|
use App\Services\ExportService;
|
||||||
use App\Services\ImportService;
|
use App\Services\ImportService;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Laracasts\Flash\Flash;
|
use Laracasts\Flash\Flash;
|
||||||
use Prettus\Repository\Criteria\RequestCriteria;
|
use Prettus\Repository\Criteria\RequestCriteria;
|
||||||
|
|
||||||
@@ -162,6 +163,8 @@ class FareController extends Controller
|
|||||||
return redirect(route('admin.fares.index'));
|
return redirect(route('admin.fares.index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log::info('Deleting fare "'.$fare->name.'", id='.$fare->id);
|
||||||
|
|
||||||
$this->fareRepo->delete($id);
|
$this->fareRepo->delete($id);
|
||||||
|
|
||||||
Flash::success('Fare deleted successfully.');
|
Flash::success('Fare deleted successfully.');
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Contracts\Controller;
|
||||||
|
use App\Services\ModuleService;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Routing\Redirector;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
class ModulesController extends Controller
|
||||||
|
{
|
||||||
|
private $moduleSvc;
|
||||||
|
|
||||||
|
public function __construct(ModuleService $moduleSvc)
|
||||||
|
{
|
||||||
|
$this->moduleSvc = $moduleSvc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a listing of the Module.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$modules = $this->moduleSvc->getAllModules();
|
||||||
|
$new_modules = $this->moduleSvc->scan();
|
||||||
|
return view('admin.modules.index', [
|
||||||
|
'modules' => $modules,
|
||||||
|
'new_modules' => $new_modules,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new Module.
|
||||||
|
*
|
||||||
|
* @return Application|Factory|View
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('admin.modules.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly Uploaded Module in the Storage.
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
*
|
||||||
|
* @return Application|RedirectResponse|Redirector
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$this->moduleSvc->installModule($request->file('module_file'));
|
||||||
|
return $this->index();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified Module.
|
||||||
|
*
|
||||||
|
* @param $id
|
||||||
|
*
|
||||||
|
* @return Application|Factory|View
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$module = $this->moduleSvc->getModule($id);
|
||||||
|
return view('admin.modules.edit', [
|
||||||
|
'module' => $module,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified Module in storage.
|
||||||
|
*
|
||||||
|
* @param $id
|
||||||
|
* @param Request $request
|
||||||
|
*
|
||||||
|
* @return Application|RedirectResponse|Redirector
|
||||||
|
*/
|
||||||
|
public function update($id, Request $request)
|
||||||
|
{
|
||||||
|
$this->moduleSvc->updateModule($id, $request->has('enabled'));
|
||||||
|
flash()->success('Module Status Changed!');
|
||||||
|
return redirect(route('admin.modules.index'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enabling Module Present in the Modules Folder
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
*
|
||||||
|
* @return Application|RedirectResponse|Redirector
|
||||||
|
*/
|
||||||
|
public function enable(Request $request)
|
||||||
|
{
|
||||||
|
$this->moduleSvc->addModule($request->input('name'));
|
||||||
|
return redirect(route('admin.modules.index'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify and Remove the specified Module from storage.
|
||||||
|
*
|
||||||
|
* @param mixed $id
|
||||||
|
* @param Request $request
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function destroy($id, Request $request)
|
||||||
|
{
|
||||||
|
$delete = $this->moduleSvc->deleteModule($id, $request->all());
|
||||||
|
if ($delete == true) {
|
||||||
|
flash()->success('Module Deleted Successfully!');
|
||||||
|
return redirect(route('admin.modules.index'));
|
||||||
|
}
|
||||||
|
flash()->error('Verification Failed!');
|
||||||
|
return redirect(route('admin.modules.edit', $id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ use App\Http\Controllers\Admin\Traits\Importable;
|
|||||||
use App\Http\Requests\CreateSubfleetRequest;
|
use App\Http\Requests\CreateSubfleetRequest;
|
||||||
use App\Http\Requests\UpdateSubfleetRequest;
|
use App\Http\Requests\UpdateSubfleetRequest;
|
||||||
use App\Models\Airline;
|
use App\Models\Airline;
|
||||||
|
use App\Models\Airport;
|
||||||
use App\Models\Enums\FareType;
|
use App\Models\Enums\FareType;
|
||||||
use App\Models\Enums\FuelType;
|
use App\Models\Enums\FuelType;
|
||||||
use App\Models\Enums\ImportExportType;
|
use App\Models\Enums\ImportExportType;
|
||||||
@@ -133,6 +134,7 @@ class SubfleetController extends Controller
|
|||||||
{
|
{
|
||||||
return view('admin.subfleets.create', [
|
return view('admin.subfleets.create', [
|
||||||
'airlines' => Airline::all()->pluck('name', 'id'),
|
'airlines' => Airline::all()->pluck('name', 'id'),
|
||||||
|
'hubs' => Airport::where('hub', 1)->pluck('name', 'id'),
|
||||||
'fuel_types' => FuelType::labels(),
|
'fuel_types' => FuelType::labels(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -203,6 +205,7 @@ class SubfleetController extends Controller
|
|||||||
|
|
||||||
return view('admin.subfleets.edit', [
|
return view('admin.subfleets.edit', [
|
||||||
'airlines' => Airline::all()->pluck('name', 'id'),
|
'airlines' => Airline::all()->pluck('name', 'id'),
|
||||||
|
'hubs' => Airport::where('hub', 1)->pluck('name', 'id'),
|
||||||
'fuel_types' => FuelType::labels(),
|
'fuel_types' => FuelType::labels(),
|
||||||
'avail_fares' => $avail_fares,
|
'avail_fares' => $avail_fares,
|
||||||
'avail_ranks' => $avail_ranks,
|
'avail_ranks' => $avail_ranks,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Http\Requests\UpdateUserRequest;
|
|||||||
use App\Models\Rank;
|
use App\Models\Rank;
|
||||||
use App\Models\Role;
|
use App\Models\Role;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Models\UserAward;
|
||||||
use App\Repositories\AirlineRepository;
|
use App\Repositories\AirlineRepository;
|
||||||
use App\Repositories\AirportRepository;
|
use App\Repositories\AirportRepository;
|
||||||
use App\Repositories\PirepRepository;
|
use App\Repositories\PirepRepository;
|
||||||
@@ -20,6 +21,7 @@ use Illuminate\Support\Facades\DB;
|
|||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Laracasts\Flash\Flash;
|
use Laracasts\Flash\Flash;
|
||||||
|
use League\ISO3166\ISO3166;
|
||||||
use Prettus\Repository\Exceptions\RepositoryException;
|
use Prettus\Repository\Exceptions\RepositoryException;
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
@@ -69,7 +71,7 @@ class UserController extends Controller
|
|||||||
|
|
||||||
return view('admin.users.index', [
|
return view('admin.users.index', [
|
||||||
'users' => $users,
|
'users' => $users,
|
||||||
'country' => new \League\ISO3166\ISO3166(),
|
'country' => new ISO3166(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,13 +84,18 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
$airlines = $this->airlineRepo->selectBoxList();
|
$airlines = $this->airlineRepo->selectBoxList();
|
||||||
$airports = $this->airportRepo->selectBoxList(false);
|
$airports = $this->airportRepo->selectBoxList(false);
|
||||||
|
$countries = collect((new ISO3166())->all())
|
||||||
|
->mapWithKeys(function ($item, $key) {
|
||||||
|
return [strtolower($item['alpha2']) => $item['name']];
|
||||||
|
});
|
||||||
|
|
||||||
return view('admin.users.create', [
|
return view('admin.users.create', [
|
||||||
'user' => null,
|
'user' => null,
|
||||||
'pireps' => null,
|
'pireps' => null,
|
||||||
'airlines' => $airlines,
|
'airlines' => $airlines,
|
||||||
'timezones' => Timezonelist::toArray(),
|
'timezones' => Timezonelist::toArray(),
|
||||||
'country' => new \League\ISO3166\ISO3166(),
|
'country' => new ISO3166(),
|
||||||
|
'countries' => $countries,
|
||||||
'airports' => $airports,
|
'airports' => $airports,
|
||||||
'ranks' => Rank::all()->pluck('name', 'id'),
|
'ranks' => Rank::all()->pluck('name', 'id'),
|
||||||
'roles' => Role::all()->pluck('name', 'id'),
|
'roles' => Role::all()->pluck('name', 'id'),
|
||||||
@@ -122,31 +129,7 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$user = $this->userRepo->findWithoutFail($id);
|
return $this->edit($id);
|
||||||
|
|
||||||
if (empty($user)) {
|
|
||||||
Flash::error('User not found');
|
|
||||||
|
|
||||||
return redirect(route('admin.users.index'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$pireps = $this->pirepRepo
|
|
||||||
->whereOrder(['user_id' => $id], 'created_at', 'desc')
|
|
||||||
->paginate();
|
|
||||||
|
|
||||||
$airlines = $this->airlineRepo->selectBoxList();
|
|
||||||
$airports = $this->airportRepo->selectBoxList(false);
|
|
||||||
|
|
||||||
return view('admin.users.show', [
|
|
||||||
'user' => $user,
|
|
||||||
'pireps' => $pireps,
|
|
||||||
'airlines' => $airlines,
|
|
||||||
'timezones' => Timezonelist::toArray(),
|
|
||||||
'country' => new \League\ISO3166\ISO3166(),
|
|
||||||
'airports' => $airports,
|
|
||||||
'ranks' => Rank::all()->pluck('name', 'id'),
|
|
||||||
'roles' => Role::all()->pluck('name', 'id'),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,12 +137,14 @@ class UserController extends Controller
|
|||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
*
|
*
|
||||||
|
* @throws RepositoryException
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$user = $this->userRepo
|
$user = $this->userRepo
|
||||||
->with(['fields', 'rank'])
|
->with(['awards', 'fields', 'rank'])
|
||||||
->findWithoutFail($id);
|
->findWithoutFail($id);
|
||||||
|
|
||||||
if (empty($user)) {
|
if (empty($user)) {
|
||||||
@@ -171,7 +156,7 @@ class UserController extends Controller
|
|||||||
->whereOrder(['user_id' => $id], 'created_at', 'desc')
|
->whereOrder(['user_id' => $id], 'created_at', 'desc')
|
||||||
->paginate();
|
->paginate();
|
||||||
|
|
||||||
$countries = collect((new \League\ISO3166\ISO3166())->all())
|
$countries = collect((new ISO3166())->all())
|
||||||
->mapWithKeys(function ($item, $key) {
|
->mapWithKeys(function ($item, $key) {
|
||||||
return [strtolower($item['alpha2']) => $item['name']];
|
return [strtolower($item['alpha2']) => $item['name']];
|
||||||
});
|
});
|
||||||
@@ -182,6 +167,7 @@ class UserController extends Controller
|
|||||||
return view('admin.users.edit', [
|
return view('admin.users.edit', [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'pireps' => $pireps,
|
'pireps' => $pireps,
|
||||||
|
'country' => new ISO3166(),
|
||||||
'countries' => $countries,
|
'countries' => $countries,
|
||||||
'timezones' => Timezonelist::toArray(),
|
'timezones' => Timezonelist::toArray(),
|
||||||
'airports' => $airports,
|
'airports' => $airports,
|
||||||
@@ -280,6 +266,28 @@ class UserController extends Controller
|
|||||||
return redirect(route('admin.users.index'));
|
return redirect(route('admin.users.index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the award from a user
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param mixed $id
|
||||||
|
* @param mixed $award_id
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function destroy_user_award($id, $award_id, Request $request)
|
||||||
|
{
|
||||||
|
$userAward = UserAward::where(['user_id' => $id, 'award_id' => $award_id]);
|
||||||
|
if (empty($userAward)) {
|
||||||
|
Flash::error('The user award could not be found');
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
|
||||||
|
$userAward->delete();
|
||||||
|
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regenerate the user's API key
|
* Regenerate the user's API key
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use App\Http\Resources\Navdata as NavdataResource;
|
|||||||
use App\Models\SimBrief;
|
use App\Models\SimBrief;
|
||||||
use App\Repositories\Criteria\WhereCriteria;
|
use App\Repositories\Criteria\WhereCriteria;
|
||||||
use App\Repositories\FlightRepository;
|
use App\Repositories\FlightRepository;
|
||||||
|
use App\Services\FareService;
|
||||||
use App\Services\FlightService;
|
use App\Services\FlightService;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -18,19 +19,26 @@ use Prettus\Repository\Exceptions\RepositoryException;
|
|||||||
|
|
||||||
class FlightController extends Controller
|
class FlightController extends Controller
|
||||||
{
|
{
|
||||||
|
/** @var \App\Services\FareService */
|
||||||
|
private $fareSvc;
|
||||||
|
|
||||||
|
/** @var \App\Repositories\FlightRepository */
|
||||||
private $flightRepo;
|
private $flightRepo;
|
||||||
|
|
||||||
|
/** @var \App\Services\FlightService */
|
||||||
private $flightSvc;
|
private $flightSvc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FlightController constructor.
|
* @param FareService $fareSvc
|
||||||
*
|
|
||||||
* @param FlightRepository $flightRepo
|
* @param FlightRepository $flightRepo
|
||||||
* @param FlightService $flightSvc
|
* @param FlightService $flightSvc
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
FareService $fareSvc,
|
||||||
FlightRepository $flightRepo,
|
FlightRepository $flightRepo,
|
||||||
FlightService $flightSvc
|
FlightService $flightSvc
|
||||||
) {
|
) {
|
||||||
|
$this->fareSvc = $fareSvc;
|
||||||
$this->flightRepo = $flightRepo;
|
$this->flightRepo = $flightRepo;
|
||||||
$this->flightSvc = $flightSvc;
|
$this->flightSvc = $flightSvc;
|
||||||
}
|
}
|
||||||
@@ -54,9 +62,13 @@ class FlightController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
|
/** @var \App\Models\User $user */
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
|
|
||||||
|
/** @var \App\Models\Flight $flight */
|
||||||
$flight = $this->flightRepo->with([
|
$flight = $this->flightRepo->with([
|
||||||
'airline',
|
'airline',
|
||||||
|
'fares',
|
||||||
'subfleets',
|
'subfleets',
|
||||||
'subfleets.aircraft',
|
'subfleets.aircraft',
|
||||||
'subfleets.fares',
|
'subfleets.fares',
|
||||||
@@ -66,7 +78,8 @@ class FlightController extends Controller
|
|||||||
},
|
},
|
||||||
])->find($id);
|
])->find($id);
|
||||||
|
|
||||||
$this->flightSvc->filterSubfleets(Auth::user(), $flight);
|
$flight = $this->flightSvc->filterSubfleets($user, $flight);
|
||||||
|
$flight = $this->fareSvc->getReconciledFaresForFlight($flight);
|
||||||
|
|
||||||
return new FlightResource($flight);
|
return new FlightResource($flight);
|
||||||
}
|
}
|
||||||
@@ -109,6 +122,7 @@ class FlightController extends Controller
|
|||||||
$flights = $this->flightRepo
|
$flights = $this->flightRepo
|
||||||
->with([
|
->with([
|
||||||
'airline',
|
'airline',
|
||||||
|
'fares',
|
||||||
'subfleets',
|
'subfleets',
|
||||||
'subfleets.aircraft',
|
'subfleets.aircraft',
|
||||||
'subfleets.fares',
|
'subfleets.fares',
|
||||||
@@ -124,7 +138,8 @@ class FlightController extends Controller
|
|||||||
|
|
||||||
// TODO: Remove any flights here that a user doesn't have permissions to
|
// TODO: Remove any flights here that a user doesn't have permissions to
|
||||||
foreach ($flights as $flight) {
|
foreach ($flights as $flight) {
|
||||||
$this->flightSvc->filterSubfleets(Auth::user(), $flight);
|
$this->flightSvc->filterSubfleets($user, $flight);
|
||||||
|
$this->fareSvc->getReconciledFaresForFlight($flight);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FlightResource::collection($flights);
|
return FlightResource::collection($flights);
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected function getUserId(Request $request)
|
protected function getUserId(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->get('id') === null) {
|
$id = $request->get('id');
|
||||||
|
if ($id === null || $id === 'me') {
|
||||||
return Auth::user()->id;
|
return Auth::user()->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,10 +90,7 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function get($id)
|
public function get($id)
|
||||||
{
|
{
|
||||||
$user = $this->userRepo
|
$user = $this->userSvc->getUser($id);
|
||||||
->with(['airline', 'bids', 'rank'])
|
|
||||||
->find($id);
|
|
||||||
|
|
||||||
return new UserResource($user);
|
return new UserResource($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +106,7 @@ class UserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function bids(Request $request)
|
public function bids(Request $request)
|
||||||
{
|
{
|
||||||
$user = $this->userRepo->find($this->getUserId($request));
|
$user = $this->userSvc->getUser($this->getUserId($request));
|
||||||
|
|
||||||
// Add a bid
|
// Add a bid
|
||||||
if ($request->isMethod('PUT') || $request->isMethod('POST')) {
|
if ($request->isMethod('PUT') || $request->isMethod('POST')) {
|
||||||
|
|||||||
@@ -42,7 +42,14 @@ class DownloadController extends Controller
|
|||||||
$category = explode('\\', $class);
|
$category = explode('\\', $class);
|
||||||
$category = end($category);
|
$category = end($category);
|
||||||
|
|
||||||
$group_name = $category.' - '.$obj->name;
|
if ($category == 'Aircraft') {
|
||||||
|
$group_name = $category.' > '.$obj->icao.' '.$obj->registration;
|
||||||
|
} elseif ($category == 'Airport') {
|
||||||
|
$group_name = $category.' > '.$obj->icao.' : '.$obj->name.' ('.$obj->country.')';
|
||||||
|
} else {
|
||||||
|
$group_name = $category.' > '.$obj->name;
|
||||||
|
}
|
||||||
|
|
||||||
$regrouped_files[$group_name] = $files;
|
$regrouped_files[$group_name] = $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ class FlightController extends Controller
|
|||||||
'saved' => $saved_flights,
|
'saved' => $saved_flights,
|
||||||
'subfleets' => $this->subfleetRepo->selectBoxList(true),
|
'subfleets' => $this->subfleetRepo->selectBoxList(true),
|
||||||
'flight_number' => $request->input('flight_number'),
|
'flight_number' => $request->input('flight_number'),
|
||||||
|
'flight_type' => $request->input('flight_type'),
|
||||||
'arr_icao' => $request->input('arr_icao'),
|
'arr_icao' => $request->input('arr_icao'),
|
||||||
'dep_icao' => $request->input('dep_icao'),
|
'dep_icao' => $request->input('dep_icao'),
|
||||||
'subfleet_id' => $request->input('subfleet_id'),
|
'subfleet_id' => $request->input('subfleet_id'),
|
||||||
|
|||||||
@@ -181,8 +181,9 @@ class PirepController extends Controller
|
|||||||
|
|
||||||
$where = [['user_id', $user->id]];
|
$where = [['user_id', $user->id]];
|
||||||
$where[] = ['state', '<>', PirepState::CANCELLED];
|
$where[] = ['state', '<>', PirepState::CANCELLED];
|
||||||
|
$with = ['airline', 'aircraft', 'dpt_airport', 'arr_airport', 'fares', 'comments'];
|
||||||
|
|
||||||
$this->pirepRepo->with(['airline', 'aircraft', 'dpt_airport', 'arr_airport'])
|
$this->pirepRepo->with($with)
|
||||||
->pushCriteria(new WhereCriteria($request, $where));
|
->pushCriteria(new WhereCriteria($request, $where));
|
||||||
$pireps = $this->pirepRepo->orderBy('created_at', 'desc')->paginate();
|
$pireps = $this->pirepRepo->orderBy('created_at', 'desc')->paginate();
|
||||||
|
|
||||||
|
|||||||
@@ -61,27 +61,14 @@ class ProfileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Redirect to show() since only a single page gets shown and the template controls
|
||||||
|
* the other items that are/aren't shown
|
||||||
|
*
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
/** @var User $user */
|
return $this->show(Auth::user()->id);
|
||||||
$user = Auth::user();
|
|
||||||
|
|
||||||
if (setting('pilots.home_hubs_only')) {
|
|
||||||
$airports = $this->airportRepo->findWhere(['hub' => true]);
|
|
||||||
} else {
|
|
||||||
$airports = $this->airportRepo->all();
|
|
||||||
}
|
|
||||||
|
|
||||||
$userFields = $this->userRepo->getUserFields($user);
|
|
||||||
|
|
||||||
return view('profile.index', [
|
|
||||||
'acars' => $this->acarsEnabled(),
|
|
||||||
'user' => $user,
|
|
||||||
'airports' => $airports,
|
|
||||||
'userFields' => $userFields,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +78,8 @@ class ProfileController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$user = User::with(['fields', 'fields.field'])
|
/** @var \App\Models\User $user */
|
||||||
|
$user = User::with(['awards', 'fields', 'fields.field'])
|
||||||
->where('id', $id)
|
->where('id', $id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
@@ -208,6 +196,7 @@ class ProfileController extends Controller
|
|||||||
});
|
});
|
||||||
|
|
||||||
$canvas->insert($image);
|
$canvas->insert($image);
|
||||||
|
Log::info('Uploading avatar into folder '.public_path('uploads/avatars'));
|
||||||
$canvas->save(public_path('uploads/avatars/'.$file_name));
|
$canvas->save(public_path('uploads/avatars/'.$file_name));
|
||||||
|
|
||||||
$req_data['avatar'] = $path;
|
$req_data['avatar'] = $path;
|
||||||
|
|||||||
@@ -80,6 +80,29 @@ class SimBriefController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the flight_id from the SimBrief Briefing (to a create a new one)
|
||||||
|
* or if no pirep_id is attached to the briefing delete it completely
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
*/
|
||||||
|
public function remove(Request $request)
|
||||||
|
{
|
||||||
|
$sb_pack = SimBrief::find($request->id);
|
||||||
|
if ($sb_pack) {
|
||||||
|
if (!$sb_pack->pirep_id) {
|
||||||
|
$sb_pack->delete();
|
||||||
|
} else {
|
||||||
|
$sb_pack->flight_id = null;
|
||||||
|
$sb_pack->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect(route('frontend.flights.index'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a prefile of this PIREP with a given OFP. Then redirect the
|
* Create a prefile of this PIREP with a given OFP. Then redirect the
|
||||||
* user to the newly prefiled PIREP
|
* user to the newly prefiled PIREP
|
||||||
|
|||||||
+14
-19
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\Importer\Http\Controllers;
|
namespace App\Http\Controllers\System;
|
||||||
|
|
||||||
use App\Contracts\Controller;
|
use App\Contracts\Controller;
|
||||||
|
use App\Services\ImporterService;
|
||||||
use App\Services\Installer\DatabaseService;
|
use App\Services\Installer\DatabaseService;
|
||||||
use App\Services\Installer\InstallerService;
|
|
||||||
use App\Support\Utils;
|
use App\Support\Utils;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Modules\Importer\Services\ImporterService;
|
|
||||||
|
|
||||||
class ImporterController extends Controller
|
class ImporterController extends Controller
|
||||||
{
|
{
|
||||||
@@ -27,13 +27,11 @@ class ImporterController extends Controller
|
|||||||
* Show the main page for the importer; show form for the admin email
|
* Show the main page for the importer; show form for the admin email
|
||||||
* and the credentials for the other database
|
* and the credentials for the other database
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
*
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index()
|
||||||
{
|
{
|
||||||
return view('importer::step1-configure');
|
return view('system.importer.step1-configure');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function testDb(Request $request)
|
protected function testDb(Request $request)
|
||||||
@@ -51,7 +49,7 @@ class ImporterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Check the database connection
|
* Check the database connection
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -62,12 +60,12 @@ class ImporterController extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$this->testDb($request);
|
$this->testDb($request);
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
$status = 'danger';
|
$status = 'danger';
|
||||||
$message = 'Failed! '.$e->getMessage();
|
$message = 'Failed! '.$e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('importer::dbtest', [
|
return view('system.importer.dbtest', [
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
]);
|
]);
|
||||||
@@ -76,7 +74,7 @@ class ImporterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* The post from the above
|
* The post from the above
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -90,17 +88,17 @@ class ImporterController extends Controller
|
|||||||
|
|
||||||
// Generate the import manifest
|
// Generate the import manifest
|
||||||
$manifest = $this->importerSvc->generateImportManifest();
|
$manifest = $this->importerSvc->generateImportManifest();
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
|
|
||||||
// Send it to run, step1
|
// Send it to run, step1
|
||||||
return view('importer::error', [
|
return view('system.importer.error', [
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send it to run, step1
|
// Send it to run, step1
|
||||||
return view('importer::step2-processing', [
|
return view('system.importer.step2-processing', [
|
||||||
'manifest' => $manifest,
|
'manifest' => $manifest,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -111,9 +109,9 @@ class ImporterController extends Controller
|
|||||||
* stage=STAGE NAME
|
* stage=STAGE NAME
|
||||||
* start=record_start
|
* start=record_start
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -136,9 +134,6 @@ class ImporterController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function complete()
|
public function complete()
|
||||||
{
|
{
|
||||||
$installerSvc = app(InstallerService::class);
|
|
||||||
$installerSvc->disableInstallerModules();
|
|
||||||
|
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+39
-40
@@ -1,25 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\Installer\Http\Controllers;
|
namespace App\Http\Controllers\System;
|
||||||
|
|
||||||
use App\Contracts\Controller;
|
use App\Contracts\Controller;
|
||||||
use App\Services\AirlineService;
|
use App\Services\AirlineService;
|
||||||
use App\Services\AnalyticsService;
|
use App\Services\AnalyticsService;
|
||||||
|
use App\Services\Installer\ConfigService;
|
||||||
use App\Services\Installer\DatabaseService;
|
use App\Services\Installer\DatabaseService;
|
||||||
use App\Services\Installer\InstallerService;
|
|
||||||
use App\Services\Installer\MigrationService;
|
use App\Services\Installer\MigrationService;
|
||||||
|
use App\Services\Installer\RequirementsService;
|
||||||
use App\Services\Installer\SeederService;
|
use App\Services\Installer\SeederService;
|
||||||
use App\Services\UserService;
|
use App\Services\UserService;
|
||||||
use App\Support\Countries;
|
use App\Support\Countries;
|
||||||
use App\Support\Utils;
|
use App\Support\Utils;
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Database\QueryException;
|
use Illuminate\Database\QueryException;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Routing\Redirector;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
use function in_array;
|
||||||
use Laracasts\Flash\Flash;
|
use Laracasts\Flash\Flash;
|
||||||
use Modules\Installer\Services\ConfigService;
|
use RuntimeException;
|
||||||
use Modules\Installer\Services\RequirementsService;
|
|
||||||
|
|
||||||
class InstallerController extends Controller
|
class InstallerController extends Controller
|
||||||
{
|
{
|
||||||
@@ -72,10 +79,10 @@ class InstallerController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (config('app.key') !== 'base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY=') {
|
if (config('app.key') !== 'base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY=') {
|
||||||
return view('installer::errors/already-installed');
|
return view('system.installer.errors.already-installed');
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('installer::install/index-start');
|
return view('system.installer.install.index-start');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function testDb(Request $request)
|
protected function testDb(Request $request)
|
||||||
@@ -92,6 +99,10 @@ class InstallerController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the database connection
|
* Check the database connection
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
*
|
||||||
|
* @return Application|Factory|View
|
||||||
*/
|
*/
|
||||||
public function dbtest(Request $request)
|
public function dbtest(Request $request)
|
||||||
{
|
{
|
||||||
@@ -100,12 +111,12 @@ class InstallerController extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$this->testDb($request);
|
$this->testDb($request);
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
$status = 'danger';
|
$status = 'danger';
|
||||||
$message = 'Failed! '.$e->getMessage();
|
$message = 'Failed! '.$e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('installer::install/dbtest', [
|
return view('system.installer.install.dbtest', [
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
]);
|
]);
|
||||||
@@ -132,11 +143,9 @@ class InstallerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Step 1. Check the modules and permissions
|
* Step 1. Check the modules and permissions
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @return Factory|View
|
||||||
*
|
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function step1(Request $request)
|
public function step1()
|
||||||
{
|
{
|
||||||
$php_version = $this->reqSvc->checkPHPVersion();
|
$php_version = $this->reqSvc->checkPHPVersion();
|
||||||
$extensions = $this->reqSvc->checkExtensions();
|
$extensions = $this->reqSvc->checkExtensions();
|
||||||
@@ -150,9 +159,9 @@ class InstallerController extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Make sure there are no false values
|
// Make sure there are no false values
|
||||||
$passed = !\in_array(false, $statuses, true);
|
$passed = !in_array(false, $statuses, true);
|
||||||
|
|
||||||
return view('installer::install/steps/step1-requirements', [
|
return view('system.installer.install.steps.step1-requirements', [
|
||||||
'php' => $php_version,
|
'php' => $php_version,
|
||||||
'extensions' => $extensions,
|
'extensions' => $extensions,
|
||||||
'directories' => $directories,
|
'directories' => $directories,
|
||||||
@@ -163,14 +172,12 @@ class InstallerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Step 2. Database Setup
|
* Step 2. Database Setup
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @return Factory|View
|
||||||
*
|
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function step2(Request $request)
|
public function step2()
|
||||||
{
|
{
|
||||||
$db_types = ['mysql' => 'mysql', 'sqlite' => 'sqlite'];
|
$db_types = ['mysql' => 'mysql', 'sqlite' => 'sqlite'];
|
||||||
return view('installer::install/steps/step2-db', [
|
return view('system.installer.install.steps.step2-db', [
|
||||||
'db_types' => $db_types,
|
'db_types' => $db_types,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -180,7 +187,7 @@ class InstallerController extends Controller
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return RedirectResponse|Redirector
|
||||||
*/
|
*/
|
||||||
public function envsetup(Request $request)
|
public function envsetup(Request $request)
|
||||||
{
|
{
|
||||||
@@ -192,7 +199,7 @@ class InstallerController extends Controller
|
|||||||
// Before writing out the env file, test the DB credentials
|
// Before writing out the env file, test the DB credentials
|
||||||
try {
|
try {
|
||||||
$this->testDb($request);
|
$this->testDb($request);
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error('Testing db before writing configs failed');
|
Log::error('Testing db before writing configs failed');
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
|
|
||||||
@@ -220,7 +227,7 @@ class InstallerController extends Controller
|
|||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
$this->envSvc->createConfigFiles($attrs);
|
$this->envSvc->createConfigFiles($attrs);
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error('Config files failed to write');
|
Log::error('Config files failed to write');
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
|
|
||||||
@@ -236,11 +243,9 @@ class InstallerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Step 2b. Setup the database
|
* Step 2b. Setup the database
|
||||||
*
|
*
|
||||||
* @param Request $request
|
|
||||||
*
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function dbsetup(Request $request)
|
public function dbsetup()
|
||||||
{
|
{
|
||||||
$console_out = '';
|
$console_out = '';
|
||||||
|
|
||||||
@@ -250,7 +255,7 @@ class InstallerController extends Controller
|
|||||||
$this->seederSvc->syncAllSeeds();
|
$this->seederSvc->syncAllSeeds();
|
||||||
} catch (QueryException $e) {
|
} catch (QueryException $e) {
|
||||||
Log::error('Error on db setup: '.$e->getMessage());
|
Log::error('Error on db setup: '.$e->getMessage());
|
||||||
dd($e);
|
//dd($e);
|
||||||
$this->envSvc->removeConfigFiles();
|
$this->envSvc->removeConfigFiles();
|
||||||
Flash::error($e->getMessage());
|
Flash::error($e->getMessage());
|
||||||
return redirect(route('installer.step2'))->withInput();
|
return redirect(route('installer.step2'))->withInput();
|
||||||
@@ -258,7 +263,7 @@ class InstallerController extends Controller
|
|||||||
|
|
||||||
$console_out = trim($console_out);
|
$console_out = trim($console_out);
|
||||||
|
|
||||||
return view('installer::install/steps/step2a-db_output', [
|
return view('system.installer.install.steps.step2a-db_output', [
|
||||||
'console_output' => $console_out,
|
'console_output' => $console_out,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -266,9 +271,9 @@ class InstallerController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Step 3. Setup the admin user and initial settings
|
* Step 3. Setup the admin user and initial settings
|
||||||
*/
|
*/
|
||||||
public function step3(Request $request)
|
public function step3()
|
||||||
{
|
{
|
||||||
return view('installer::install/steps/step3-user', [
|
return view('system.installer.install.steps.step3-user', [
|
||||||
'countries' => Countries::getSelectList(),
|
'countries' => Countries::getSelectList(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -278,9 +283,8 @@ class InstallerController extends Controller
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @throws \RuntimeException
|
* @throws RuntimeException
|
||||||
* @throws \Prettus\Validator\Exceptions\ValidatorException
|
* @throws Exception
|
||||||
* @throws \Exception
|
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@@ -337,21 +341,16 @@ class InstallerController extends Controller
|
|||||||
// Try sending telemetry info
|
// Try sending telemetry info
|
||||||
$this->analyticsSvc->sendInstall();
|
$this->analyticsSvc->sendInstall();
|
||||||
|
|
||||||
return view('installer::install/steps/step3a-completed', []);
|
return view('system.installer.install.steps.step3a-completed', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Final step
|
* Final step
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @return RedirectResponse|Redirector
|
||||||
*
|
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
|
||||||
*/
|
*/
|
||||||
public function complete(Request $request)
|
public function complete()
|
||||||
{
|
{
|
||||||
$installerSvc = app(InstallerService::class);
|
|
||||||
$installerSvc->disableInstallerModules();
|
|
||||||
|
|
||||||
return redirect('/login');
|
return redirect('/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+15
-21
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Modules\Updater\Http\Controllers;
|
namespace App\Http\Controllers\System;
|
||||||
|
|
||||||
use App\Contracts\Controller;
|
use App\Contracts\Controller;
|
||||||
use App\Repositories\KvpRepository;
|
use App\Repositories\KvpRepository;
|
||||||
@@ -10,8 +10,10 @@ use App\Services\Installer\MigrationService;
|
|||||||
use App\Services\Installer\SeederService;
|
use App\Services\Installer\SeederService;
|
||||||
use Codedge\Updater\UpdaterManager;
|
use Codedge\Updater\UpdaterManager;
|
||||||
use function count;
|
use function count;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class UpdateController extends Controller
|
class UpdateController extends Controller
|
||||||
{
|
{
|
||||||
@@ -51,18 +53,16 @@ class UpdateController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('updater::index-start');
|
return view('system.updater.index-start');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Step 1. Check if there's an update available. Check if there
|
* Step 1. Check if there's an update available. Check if there
|
||||||
* are any unrun migrations
|
* are any unrun migrations
|
||||||
*
|
*
|
||||||
* @param Request $request
|
|
||||||
*
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function step1(Request $request)
|
public function step1()
|
||||||
{
|
{
|
||||||
$this->installerSvc->clearCaches();
|
$this->installerSvc->clearCaches();
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class UpdateController extends Controller
|
|||||||
Log::info('Upgrade is pending');
|
Log::info('Upgrade is pending');
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('updater::steps/step1-update-available');
|
return view('system.updater.steps.step1-update-available');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,13 +87,13 @@ class UpdateController extends Controller
|
|||||||
$migrations = $this->migrationSvc->migrationsAvailable();
|
$migrations = $this->migrationSvc->migrationsAvailable();
|
||||||
if (count($migrations) === 0) {
|
if (count($migrations) === 0) {
|
||||||
$this->seederSvc->syncAllSeeds();
|
$this->seederSvc->syncAllSeeds();
|
||||||
return view('updater::steps/step3-update-complete');
|
return view('system.updater.steps.step3-update-complete');
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = $this->migrationSvc->runAllMigrations();
|
$output = $this->migrationSvc->runAllMigrations();
|
||||||
$this->seederSvc->syncAllSeeds();
|
$this->seederSvc->syncAllSeeds();
|
||||||
|
|
||||||
return view('updater::steps/step2-migrations-done', [
|
return view('system.updater.steps.step2-migrations-done', [
|
||||||
'console_output' => $output,
|
'console_output' => $output,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -101,27 +101,23 @@ class UpdateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Final step
|
* Final step
|
||||||
*
|
*
|
||||||
* @param Request $request
|
|
||||||
*
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function complete(Request $request)
|
public function complete()
|
||||||
{
|
{
|
||||||
return redirect('/login');
|
return redirect('/admin');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the update page with the latest version
|
* Show the update page with the latest version
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @return Factory|View
|
||||||
*
|
|
||||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
||||||
*/
|
*/
|
||||||
public function updater(Request $request)
|
public function updater()
|
||||||
{
|
{
|
||||||
$version = $this->kvpRepo->get('latest_version_tag');
|
$version = $this->kvpRepo->get('latest_version_tag');
|
||||||
|
|
||||||
return view('updater::downloader/downloader', [
|
return view('system.updater.downloader/downloader', [
|
||||||
'version' => $version,
|
'version' => $version,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -129,15 +125,13 @@ class UpdateController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Download the actual update and then forward the user to the updater page
|
* Download the actual update and then forward the user to the updater page
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
*
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function update_download(Request $request)
|
public function update_download()
|
||||||
{
|
{
|
||||||
$version = $this->kvpRepo->get('latest_version_tag');
|
$version = $this->kvpRepo->get('latest_version_tag');
|
||||||
if (empty($version)) {
|
if (empty($version)) {
|
||||||
return view('updater::steps/step1-no-update');
|
return view('system.updater.steps.step1-no-update');
|
||||||
}
|
}
|
||||||
|
|
||||||
$release = $this->updateManager->source('github')->fetch($version);
|
$release = $this->updateManager->source('github')->fetch($version);
|
||||||
@@ -11,7 +11,7 @@ class PrefileRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'airline_id' => 'required|exists:airlines,id',
|
'airline_id' => 'required|exists:airlines,id',
|
||||||
'aircraft_id' => 'required|exists:aircraft,id',
|
'aircraft_id' => 'required|exists:aircraft,id',
|
||||||
'flight_id' => 'sometimes|exists:flights,id',
|
'flight_id' => 'sometimes|nullable|exists:flights,id',
|
||||||
'flight_number' => 'required',
|
'flight_number' => 'required',
|
||||||
'dpt_airport_id' => 'required',
|
'dpt_airport_id' => 'required',
|
||||||
'arr_airport_id' => 'required',
|
'arr_airport_id' => 'required',
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ class Fare extends Resource
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'code' => $this->code,
|
'code' => $this->code,
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'price' => $this->price,
|
|
||||||
'cost' => $this->cost,
|
|
||||||
'capacity' => $this->capacity,
|
'capacity' => $this->capacity,
|
||||||
|
'cost' => $this->cost,
|
||||||
|
'price' => $this->price,
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
'notes' => $this->notes,
|
'notes' => $this->notes,
|
||||||
'active' => $this->active,
|
'active' => $this->active,
|
||||||
|
|||||||
@@ -18,17 +18,17 @@ class Flight extends Resource
|
|||||||
private function setFields()
|
private function setFields()
|
||||||
{
|
{
|
||||||
/** @var \Illuminate\Support\Collection $field_values */
|
/** @var \Illuminate\Support\Collection $field_values */
|
||||||
|
$return_values = new stdClass();
|
||||||
$field_values = $this->field_values;
|
$field_values = $this->field_values;
|
||||||
if (empty($field_values) || $field_values->count() === 0) {
|
if (empty($field_values) || $field_values->count() === 0) {
|
||||||
return new stdClass();
|
return $return_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = [];
|
|
||||||
foreach ($field_values as $field) {
|
foreach ($field_values as $field) {
|
||||||
$fields[$field->name] = $field->value;
|
$return_values->{$field->name} = $field->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fields;
|
return $return_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class User extends Resource
|
|||||||
'pilot_id' => $this->pilot_id,
|
'pilot_id' => $this->pilot_id,
|
||||||
'ident' => $this->ident,
|
'ident' => $this->ident,
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
|
'name_private' => $this->name_private,
|
||||||
'email' => $this->email,
|
'email' => $this->email,
|
||||||
'avatar' => $this->resolveAvatarUrl(),
|
'avatar' => $this->resolveAvatarUrl(),
|
||||||
'rank_id' => $this->rank_id,
|
'rank_id' => $this->rank_id,
|
||||||
@@ -31,6 +32,7 @@ class User extends Resource
|
|||||||
$res['airline'] = Airline::make($this->whenLoaded('airline'));
|
$res['airline'] = Airline::make($this->whenLoaded('airline'));
|
||||||
$res['bids'] = UserBid::collection($this->whenLoaded('bids'));
|
$res['bids'] = UserBid::collection($this->whenLoaded('bids'));
|
||||||
$res['rank'] = Rank::make($this->whenLoaded('rank'));
|
$res['rank'] = Rank::make($this->whenLoaded('rank'));
|
||||||
|
$res['subfleets'] = Subfleet::make($this->whenLoaded('subfleets'));
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners;
|
||||||
|
|
||||||
|
use App\Contracts\Listener;
|
||||||
|
use App\Events\PirepAccepted;
|
||||||
|
use App\Events\UserStateChanged;
|
||||||
|
use App\Events\UserStatsChanged;
|
||||||
|
use App\Models\Award;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Look for and run any of the award classes. Don't modify this.
|
||||||
|
* See the documentation on creating awards:
|
||||||
|
*
|
||||||
|
* @url http://docs.phpvms.net/customizing/awards
|
||||||
|
*/
|
||||||
|
class AwardHandler extends Listener
|
||||||
|
{
|
||||||
|
/** The events and the callback */
|
||||||
|
public static $callbacks = [
|
||||||
|
PirepAccepted::class => 'onPirepAccept',
|
||||||
|
UserStatsChanged::class => 'onUserStatsChanged',
|
||||||
|
UserStateChanged::class => 'onUserStateChanged',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a PIREP is accepted
|
||||||
|
*
|
||||||
|
* @param \App\Events\PirepAccepted $event
|
||||||
|
*/
|
||||||
|
public function onPirepAccept(PirepAccepted $event)
|
||||||
|
{
|
||||||
|
$this->checkForAwards($event->pirep->user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When the user's state has changed
|
||||||
|
*
|
||||||
|
* @param \App\Events\UserStateChanged $event
|
||||||
|
*/
|
||||||
|
public function onUserStateChanged(UserStateChanged $event): void
|
||||||
|
{
|
||||||
|
$this->checkForAwards($event->user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when any of the user's states have changed
|
||||||
|
*
|
||||||
|
* @param UserStatsChanged $event
|
||||||
|
*/
|
||||||
|
public function onUserStatsChanged(UserStatsChanged $event): void
|
||||||
|
{
|
||||||
|
$this->checkForAwards($event->user);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for any awards to be run and test them against the user
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
*/
|
||||||
|
public function checkForAwards($user)
|
||||||
|
{
|
||||||
|
$awards = Award::all();
|
||||||
|
foreach ($awards as $award) {
|
||||||
|
$klass = $award->getReference($award, $user);
|
||||||
|
if ($klass) {
|
||||||
|
$klass->handle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Listeners;
|
|
||||||
|
|
||||||
use App\Contracts\Listener;
|
|
||||||
use App\Events\UserStatsChanged;
|
|
||||||
use App\Models\Award;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Look for and run any of the award classes. Don't modify this.
|
|
||||||
* See the documentation on creating awards:
|
|
||||||
*
|
|
||||||
* @url http://docs.phpvms.net/customizing/awards
|
|
||||||
*/
|
|
||||||
class AwardListener extends Listener
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Call all of the awards
|
|
||||||
*
|
|
||||||
* @param UserStatsChanged $event
|
|
||||||
*/
|
|
||||||
public function handle(UserStatsChanged $event): void
|
|
||||||
{
|
|
||||||
$awards = Award::all();
|
|
||||||
foreach ($awards as $award) {
|
|
||||||
$klass = $award->getReference($award, $event->user);
|
|
||||||
if ($klass) {
|
|
||||||
$klass->handle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -97,6 +97,11 @@ class Airline extends Model
|
|||||||
$this->attributes['icao'] = strtoupper($icao);
|
$this->attributes['icao'] = strtoupper($icao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function subfleets()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Subfleet::class, 'airline_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function flights()
|
public function flights()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Flight::class, 'airline_id');
|
return $this->belongsTo(Flight::class, 'airline_id');
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ use Illuminate\Support\Collection;
|
|||||||
* @property int distance
|
* @property int distance
|
||||||
* @property int flight_time
|
* @property int flight_time
|
||||||
* @property string route
|
* @property string route
|
||||||
|
* @property string dpt_time
|
||||||
|
* @property string arr_time
|
||||||
|
* @property string flight_type
|
||||||
|
* @property string notes
|
||||||
* @property int level
|
* @property int level
|
||||||
* @property float load_factor
|
* @property float load_factor
|
||||||
* @property float load_factor_variance
|
* @property float load_factor_variance
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Contracts\Model;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string name
|
||||||
|
* @property bool enabled
|
||||||
|
* @property Carbon created_at
|
||||||
|
* @property Carbon updated_at
|
||||||
|
*/
|
||||||
|
class Module extends Model
|
||||||
|
{
|
||||||
|
public $table = 'modules';
|
||||||
|
|
||||||
|
public $fillable = [
|
||||||
|
'name',
|
||||||
|
'enabled',
|
||||||
|
'created_at',
|
||||||
|
'updated_at',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'enabled' => 'boolean',
|
||||||
|
];
|
||||||
|
|
||||||
|
public static $rules = [
|
||||||
|
'name' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -75,6 +75,7 @@ class Pirep extends Model
|
|||||||
'flight_number',
|
'flight_number',
|
||||||
'route_code',
|
'route_code',
|
||||||
'route_leg',
|
'route_leg',
|
||||||
|
'flight_id',
|
||||||
'dpt_airport_id',
|
'dpt_airport_id',
|
||||||
'arr_airport_id',
|
'arr_airport_id',
|
||||||
'alt_airport_id',
|
'alt_airport_id',
|
||||||
|
|||||||
+12
-6
@@ -8,30 +8,28 @@ use App\Models\Traits\ExpensableTrait;
|
|||||||
use App\Models\Traits\FilesTrait;
|
use App\Models\Traits\FilesTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Subfleet
|
|
||||||
*
|
|
||||||
* @property int id
|
* @property int id
|
||||||
* @property string type
|
* @property string type
|
||||||
* @property string name
|
* @property string name
|
||||||
|
* @property int airline_id
|
||||||
|
* @property int hub_id
|
||||||
* @property string ground_handling_multiplier
|
* @property string ground_handling_multiplier
|
||||||
* @property Fare[] fares
|
* @property Fare[] fares
|
||||||
* @property float cost_block_hour
|
* @property float cost_block_hour
|
||||||
* @property float cost_delay_minute
|
* @property float cost_delay_minute
|
||||||
* @property Airline airline
|
* @property Airline airline
|
||||||
* @property int airline_id
|
* @property Airport hub
|
||||||
*/
|
*/
|
||||||
class Subfleet extends Model
|
class Subfleet extends Model
|
||||||
{
|
{
|
||||||
use ExpensableTrait;
|
use ExpensableTrait;
|
||||||
use FilesTrait;
|
use FilesTrait;
|
||||||
|
|
||||||
public $table = 'subfleets';
|
|
||||||
|
|
||||||
public $fillable = [
|
public $fillable = [
|
||||||
'airline_id',
|
'airline_id',
|
||||||
|
'hub_id',
|
||||||
'type',
|
'type',
|
||||||
'name',
|
'name',
|
||||||
'turn_time',
|
|
||||||
'fuel_type',
|
'fuel_type',
|
||||||
'cost_block_hour',
|
'cost_block_hour',
|
||||||
'cost_delay_minute',
|
'cost_delay_minute',
|
||||||
@@ -41,6 +39,8 @@ class Subfleet extends Model
|
|||||||
'gross_weight',
|
'gross_weight',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public $table = 'subfleets';
|
||||||
|
|
||||||
public $casts = [
|
public $casts = [
|
||||||
'airline_id' => 'integer',
|
'airline_id' => 'integer',
|
||||||
'turn_time' => 'integer',
|
'turn_time' => 'integer',
|
||||||
@@ -56,6 +56,7 @@ class Subfleet extends Model
|
|||||||
public static $rules = [
|
public static $rules = [
|
||||||
'type' => 'required',
|
'type' => 'required',
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
|
'hub_id' => 'nullable',
|
||||||
'ground_handling_multiplier' => 'nullable|numeric',
|
'ground_handling_multiplier' => 'nullable|numeric',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -82,6 +83,11 @@ class Subfleet extends Model
|
|||||||
return $this->belongsTo(Airline::class, 'airline_id');
|
return $this->belongsTo(Airline::class, 'airline_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hub()
|
||||||
|
{
|
||||||
|
return $this->hasOne(Airport::class, 'id', 'hub_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function fares()
|
public function fares()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Fare::class, 'subfleet_fare')
|
return $this->belongsToMany(Fare::class, 'subfleet_fare')
|
||||||
|
|||||||
+5
-1
@@ -36,6 +36,7 @@ use Laratrust\Traits\LaratrustUserTrait;
|
|||||||
* @property int state
|
* @property int state
|
||||||
* @property bool opt_in
|
* @property bool opt_in
|
||||||
* @property string last_pirep_id
|
* @property string last_pirep_id
|
||||||
|
* @property Pirep last_pirep
|
||||||
* @property UserFieldValue[] fields
|
* @property UserFieldValue[] fields
|
||||||
*
|
*
|
||||||
* @mixin \Illuminate\Database\Eloquent\Builder
|
* @mixin \Illuminate\Database\Eloquent\Builder
|
||||||
@@ -208,9 +209,12 @@ class User extends Authenticatable
|
|||||||
return $this->belongsTo(Airline::class, 'airline_id');
|
return $this->belongsTo(Airline::class, 'airline_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \App\Models\Award[]|mixed
|
||||||
|
*/
|
||||||
public function awards()
|
public function awards()
|
||||||
{
|
{
|
||||||
return $this->hasMany(UserAward::class, 'user_id');
|
return $this->belongsToMany(Award::class, 'user_awards');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace App\Providers;
|
|||||||
use App\Events\Expenses;
|
use App\Events\Expenses;
|
||||||
use App\Events\PirepFiled;
|
use App\Events\PirepFiled;
|
||||||
use App\Events\UserStatsChanged;
|
use App\Events\UserStatsChanged;
|
||||||
use App\Listeners\AwardListener;
|
use App\Listeners\AwardHandler;
|
||||||
use App\Listeners\BidEventHandler;
|
use App\Listeners\BidEventHandler;
|
||||||
use App\Listeners\ExpenseListener;
|
use App\Listeners\ExpenseListener;
|
||||||
use App\Listeners\FinanceEventHandler;
|
use App\Listeners\FinanceEventHandler;
|
||||||
@@ -33,7 +33,7 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
],
|
],
|
||||||
|
|
||||||
UserStatsChanged::class => [
|
UserStatsChanged::class => [
|
||||||
AwardListener::class,
|
|
||||||
],
|
],
|
||||||
|
|
||||||
UpdateAvailable::class => [],
|
UpdateAvailable::class => [],
|
||||||
@@ -44,5 +44,6 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
BidEventHandler::class,
|
BidEventHandler::class,
|
||||||
FinanceEventHandler::class,
|
FinanceEventHandler::class,
|
||||||
EventHandler::class,
|
EventHandler::class,
|
||||||
|
AwardHandler::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user