Skip to content
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

Update to Laravel 11 #32

Merged
merged 7 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
Expand Down
60 changes: 39 additions & 21 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,63 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_APP_NAME="${APP_NAME}"
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
* text=auto
* text=auto eol=lf

*.md diff=markdown
*.php diff=php
14 changes: 6 additions & 8 deletions .github/workflows/autoformat.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Autoformat

on:
push:
branches:
Expand All @@ -9,32 +7,32 @@ jobs:
composer-normalize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.0
php-version: 8.3

- run: composer install --no-interaction --no-progress --no-suggest
- uses: ramsey/composer-install@v3

- run: composer normalize

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Normalize composer.json

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- uses: creyD/prettier_action@v4.2
- uses: creyD/prettier_action@v4.3
with:
prettier_options: --write --tab-width=2 *.md **/*.md
branch: ${{ github.head_ref }}
Expand Down
64 changes: 0 additions & 64 deletions .github/workflows/continuous-integration.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
pull_request:
push:
branches:
- master

env:
PHP_EXTENSIONS: mbstring, mysqli, pdo_mysql
PHP_VERSION: 8.3
APP_ENV: testing

jobs:
static-code-analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: ${{ env.PHP_EXTENSIONS }}
php-version: ${{ env.PHP_VERSION }}

- uses: ramsey/composer-install@v3

- run: vendor/bin/phpstan

tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: ${{ env.PHP_EXTENSIONS }}
php-version: ${{ env.PHP_VERSION }}

- uses: ramsey/composer-install@v3

- run: touch database/database.sqlite

- run: php artisan migrate

- run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
/.phpunit.result.cache
/_ide_helper.php
/_lighthouse_ide_helper.php
/schema-directives.graphql
/programmatic-types.graphql
/schema-directives.graphql
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@

**An example project using [nuwave/lighthouse](https://github.com/nuwave/lighthouse).**

## Setup

```shell
composer install
cp .env.example .env
touch database/database.sqlite
php artisan migrate
```

## Usage

Run the server with the following command:

```shell
php artisan serve
```

Access [the GraphiQL UI](https://github.com/graphql/graphiql/blob/main/packages/graphiql/README.md) at `/graphiql`.

</div>

## Minimalism
Expand Down
13 changes: 0 additions & 13 deletions app/Console/Kernel.php

This file was deleted.

9 changes: 0 additions & 9 deletions app/Exceptions/Handler.php

This file was deleted.

51 changes: 0 additions & 51 deletions app/Http/Kernel.php

This file was deleted.

1 change: 1 addition & 0 deletions app/Models/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
final class Comment extends Model
{
/** @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\Post, self> */
public function post(): BelongsTo
{
return $this->belongsTo(Post::class);
Expand Down
Loading
Loading