Skip to content

Commit

Permalink
Merge pull request #74 from nspalo/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
nspalo authored Sep 16, 2023
2 parents e0e37bd + 93ecb8e commit f58bbd5
Show file tree
Hide file tree
Showing 55 changed files with 2,053 additions and 10,725 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches: [ "master", "development" ]

jobs:

build:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -39,15 +40,14 @@ jobs:
- name: Run Composer
run: |
./scripts/composer.sh install
./scripts/composer.sh dump-autoload
./scripts/composer.sh run post-root-package-install
./scripts/composer.sh run post-create-project-cmd
# NPM
- name: Run NPM
run: |
./scripts/run.sh npm install --loglevel=error
./scripts/run.sh npm run development
./scripts/run.sh npm install
./scripts/run.sh npm run build
# Code Quality Check
- name: Run PhpStan
Expand Down
2 changes: 1 addition & 1 deletion docker/containers/composer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Pull from PHP from previous Dockerfile - php/Dockerfile
# - see docker/docker-compose.yml for more info
# - use the image tag php:php-8.1-fpm-alpine
FROM php:php-8.1-fpm-alpine
FROM php:php-8.2-fpm-alpine

# Install Composer 2.6.1
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.6.1
Expand Down
4 changes: 2 additions & 2 deletions docker/containers/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install PHP 8.1
FROM php:8.1-fpm-alpine
# Install PHP 8.2
FROM php:8.2-fpm-alpine

# Install PHP Extension
RUN apk --no-cache add zip libzip-dev \
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
build:
context: .
dockerfile: containers/php/Dockerfile
image: php:php-8.1-fpm-alpine
image: php:php-8.2-fpm-alpine
ports:
- "9000:9000"
volumes:
Expand Down Expand Up @@ -110,7 +110,7 @@ services:
build:
context: .
dockerfile: containers/php/Dockerfile
image: artisan:laravel-8
image: artisan:laravel-9
links:
- php
- database
Expand Down
5 changes: 0 additions & 5 deletions scripts/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -eo pipefail

#docker compose \
# --env-file "docker/environments/config.env" \
# -f "docker/docker-compose.yml" \
# run --rm \
# ${@}
./scripts/main-docker-compose.sh \
exec \
${@}
4 changes: 2 additions & 2 deletions src/.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
16 changes: 11 additions & 5 deletions src/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
Expand All @@ -29,12 +29,12 @@ REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
Expand All @@ -46,7 +46,13 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
1 change: 1 addition & 0 deletions src/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore
5 changes: 4 additions & 1 deletion src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
14 changes: 0 additions & 14 deletions src/.styleci.yml

This file was deleted.

8 changes: 5 additions & 3 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
Expand All @@ -25,7 +25,9 @@ Laravel is accessible, powerful, and provides tools required for large, robust a

Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

## Laravel Sponsors

Expand Down
13 changes: 11 additions & 2 deletions src/app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@

class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
//
];

/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<Throwable>>
* @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
* A list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
Expand Down
6 changes: 3 additions & 3 deletions src/app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Kernel extends HttpKernel
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand All @@ -35,7 +35,6 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
Expand All @@ -58,11 +57,12 @@ class Kernel extends HttpKernel
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
Expand Down
4 changes: 1 addition & 3 deletions src/app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ class Authenticate extends Middleware
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request): ?string
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}

return null;
}
}
24 changes: 24 additions & 0 deletions src/app/Http/Middleware/ValidateSignature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace App\Http\Middleware;

use Illuminate\Routing\Middleware\ValidateSignature as Middleware;

class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}
1 change: 1 addition & 0 deletions src/app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Models;

// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
Expand Down
3 changes: 2 additions & 1 deletion src/app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

namespace App\Providers;

// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
Expand Down
12 changes: 11 additions & 1 deletion src/app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
Expand All @@ -31,4 +31,14 @@ public function boot()
{
//
}

/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
return false;
}
}
23 changes: 7 additions & 16 deletions src/app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,27 @@ class RouteServiceProvider extends ServiceProvider
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
* Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/home';

/**
* The controller namespace for the application.
* Define your route model bindings, pattern filters, and other route configuration.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
protected $namespace = ''; // 'App\\Http\\Controllers';

/**
* Define your route model bindings, pattern filters, etc.
* @return void
*/
public function boot(): void
public function boot()
{
$this->configureRateLimiting();

$this->routes(function () {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));

Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
Expand All @@ -57,7 +48,7 @@ public function boot(): void
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
}
}
2 changes: 0 additions & 2 deletions src/bootstrap/cache/.gitignore

This file was deleted.

Loading

0 comments on commit f58bbd5

Please sign in to comment.