-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[main] Update framework to version 10 #106
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
3635851
Add files via upload
Kipjr 80cfaad
Create docker-publish.yml
Kipjr ba7b655
Create laravel.yml
Kipjr b745c85
Create DOCKER.md
Kipjr da3ab65
Create docker-compose.yml
Kipjr 95f0884
Update docker-publish.yml
Kipjr 16d6f3d
Remove "new" info
Kipjr 330a750
Rewrite docker-compose.yml
Kipjr f051517
Install sail
Kipjr 6ee7445
Force HTTPS
Kipjr cec7747
Fix: Trusted Proxies (Upgrade 8->9)
Kipjr cde9759
Fix exception handler
Kipjr d0138fc
Upgrade laravel from 6->10
Kipjr f5d64bb
Fix class naming issue
Kipjr 354e40c
remove yarn
Kipjr f050438
Fix badges
Kipjr ae00a68
Implement changes of https://github.com/laravel/laravel/compare/6.x..…
Kipjr fa2db91
Fix: missing middleware
Kipjr fa9156a
Fix: primairy id
Kipjr 8b5b3f9
Fix: new style routing
Kipjr 83ab12c
Fix: inconsistencies with mensaId and Id
Kipjr a92f596
Fix: missing mensaId / id
Kipjr c4f4efd
Fix mensaId / id
Kipjr 1afe2d2
Update UserFactory.php
Kipjr e84d77f
I hate spaces
Kipjr a22c257
update composer
Kipjr 54dea60
Update docker-publish.yml
Kipjr 20b66e9
Update laravel.yml
Kipjr 4d75a06
Update laravel.yml with db location
Kipjr 531273e
Seed db
Kipjr 197f2a0
fix env
Kipjr 34c3cc0
Fix wrong copy and @ in EventServiceProvider.php
Kipjr 64ea7f9
Restore and migrate Handler.php
Kipjr d31ce99
Fix missing bracket
Kipjr 1c300dc
Change method of parent
Kipjr 78e6aff
Restore parent method
Kipjr 1b13d87
Remove parent class
Kipjr 6b545b7
Add tests
Kipjr ba0b1ac
increase logging phpunit
Kipjr 4c22a72
update .env.example with docker-vars
Kipjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
# Publish `main` as Docker `latest` image. | ||
tags: [ 'v*.*.*' ] | ||
workflow_dispatch: | ||
|
||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
# Run tests. | ||
# See also https://docs.docker.com/docker-hub/builds/automated-testing/ | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Copy .env | ||
run: | | ||
if [[ ! -f '.env' ]];then | ||
cp '.env.example' '.env' | ||
fi | ||
- name: Install Dependencies | ||
run: composer require laravel/sail -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
|
||
- name: Run tests | ||
run: | | ||
if [ -f docker-compose.test.yml ]; then | ||
docker-compose --file docker-compose.test.yml build | ||
docker-compose --file docker-compose.test.yml run sut | ||
else | ||
docker-compose build | ||
fi | ||
# Push image to GitHub Packages. | ||
# See also https://docs.docker.com/docker-hub/builds/ | ||
push: | ||
# Ensure test job passes before pushing image. | ||
needs: test | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Login against a Docker registry except on PR | ||
# https://github.com/docker/login-action | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Extract metadata (tags, labels) for Docker | ||
# https://github.com/docker/metadata-action | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
# Build and push Docker image with Buildx (don't push on PR) | ||
# https://github.com/docker/build-push-action | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Laravel | ||
|
||
on: | ||
push: | ||
branches: [ development ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
laravel-tests: | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
DB_CONNECTION: sqlite | ||
DB_DATABASE: database.sqlite | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Copy .env | ||
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Generate key | ||
run: php artisan key:generate | ||
- name: Directory Permissions | ||
run: chmod -R 777 storage bootstrap/cache | ||
- name: Create Database | ||
run: | | ||
mkdir -p database | ||
touch database/database.sqlite | ||
- name: Fill database | ||
run: | | ||
php artisan migrate:fresh | ||
php artisan db:seed | ||
- name: Execute tests (Unit and Feature tests) via PHPUnit | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
*Main* | ||
|
||
[![Docker (Branch: Main)](https://github.com/VSLCatena/mensa/actions/workflows/docker-publish.yml/badge.svg?branch=main-docker)](https://github.com/VSLCatena/mensa/actions/workflows/docker-publish.yml) | ||
[![Laravel (Branch: main)](https://github.com/VSLCatena/mensa/actions/workflows/laravel.yml/badge.svg?branch=main-docker)](https://github.com/VSLCatena/mensa/actions/workflows/laravel.yml) | ||
|
||
*Development* | ||
|
||
[![Docker (Branch: development)](https://github.com/VSLCatena/mensa/actions/workflows/docker-publish.yml/badge.svg?branch=development)](https://github.com/VSLCatena/mensa/actions/workflows/docker-publish.yml) | ||
[![Laravel (Branch: development)](https://github.com/VSLCatena/mensa/actions/workflows/laravel.yml/badge.svg?branch=development)](https://github.com/VSLCatena/mensa/actions/workflows/laravel.yml) | ||
|
||
|
||
# mensa | ||
Mensa is an enrollment system for dinner that we use at our student association. | ||
You can create dinners and assign them to cooks, who can change the dinner by adding a menu and changing some extra | ||
info. | ||
|
||
The back-end works through a PHP server, the front-end is html/javascript which talks to back-end through AJAX calls. | ||
This means that with very little adjustments you could split front-end from back-end. | ||
|
||
|
||
## Setup | ||
|
||
### .env file | ||
All configuration of the app itself should be doable through the .env file. | ||
If you don't have a .env file available, you can duplicate the .env.example file to create a new .env file. | ||
|
||
### Authorization | ||
For authorization we use Active Directory. For this you'll need to make sure PHP-LDAP works | ||
|
||
### Building the app | ||
For production I recommend to look at, and following the | ||
[Laravel deployment page](https://laravel.com/docs/8.x/deployment). | ||
Here you can see the laravel requirements and some optimizations you can do for Laravel such as caching options. | ||
|
||
#### Here are just the bare minimals for development purposes: | ||
To set up composer (Package manager for PHP): | ||
`composer install` | ||
|
||
To set up npm (Package manager for Javascript): | ||
`npm install` | ||
`npm run dev` | ||
|
||
To run migrations: | ||
`php artisan migrate` | ||
|
||
To fill in mock data in the database: | ||
`php artisan db:seed` | ||
|
||
|
||
|
||
## Running the app for development | ||
For running the PHP server: | ||
`php artisan serve` | ||
This will keep a server running, and changes are reflected immediately. | ||
|
||
For compiling the front-end source: | ||
`npm run watch` | ||
This will keep npm running, a new build will automatically start on every file changes, | ||
so changes are reflected on page refresh. | ||
|
||
These two commands have made my life a lot better :) | ||
|
||
|
||
## Docker | ||
Info about how to get it working in docker can be found [Here](docs/DOCKER.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this code go?