Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit d52f2558 authored by Nicolas's avatar Nicolas
Browse files

feat: upgrade to laravel 11

parent 0fdc571a
No related branches found
No related tags found
No related merge requests found
Showing
with 117 additions and 350 deletions
# -*- coding: utf-8 -*-
FROM httpd:2.4.57-alpine3.18
FROM httpd:2.4.58-alpine3.19
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.1"
LABEL version="1.2"
# Change port and update server name
# Enable proxy and fcgi modules
......
# -*- coding: utf-8 -*-
FROM nginx:1.25.1-alpine3.17
FROM nginx:1.25.4-alpine3.18
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.1"
LABEL version="1.2"
# installe les dependances requises
RUN apk --no-cache --no-progress upgrade > /dev/null \
&& apk --no-cache --no-progress add \
"openrc=0.45.2-r7"
"openrc=0.53-r1"
# Créé l'utilisateur app
RUN addgroup -g 1000 app \
......
# -*- coding: utf-8 -*-
FROM php:8.2.7-fpm-alpine3.18
FROM php:8.3.3-fpm-alpine3.19
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.1"
LABEL version="1.2"
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
......@@ -13,18 +13,27 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Permet d'installer les dépendances nécessaires à PECL
RUN apk --no-cache --no-progress upgrade > /dev/null \
&& apk --no-cache --no-progress add \
$PHPIZE_DEPS \
"curl=8.1.2-r0" \
"freetype-dev=2.13.0-r5" \
"git=2.40.1-r0" \
"gzip=1.12-r1" \
"libjpeg-turbo-dev=2.1.5.1-r3" \
"libpng-dev=1.6.39-r3" \
"libwebp-dev=1.3.0-r2" \
"libzip-dev=1.9.2-r2" \
"linux-headers=6.3-r0" \
"mysql-client=10.11.4-r0" \
"oniguruma-dev=6.9.8-r1" \
"autoconf=2.71-r2" \
"dpkg-dev=1.22.1-r0" \
"dpkg=1.22.1-r0" \
"file=5.45-r1" \
"g++=13.2.1_git20231014-r0" \
"gcc=13.2.1_git20231014-r0" \
"libc-dev=0.7.2-r5" \
"make=4.4.1-r2" \
"pkgconf=2.1.0-r0" \
"re2c=3.1-r0" \
"curl=8.5.0-r0" \
"freetype-dev=2.13.2-r0" \
"git=2.43.0-r0" \
"gzip=1.13-r0" \
"libjpeg-turbo-dev=3.0.1-r0" \
"libpng-dev=1.6.40-r0" \
"libwebp-dev=1.3.2-r0" \
"libzip-dev=1.10.1-r0" \
"linux-headers=6.5-r0" \
"mysql-client=10.11.6-r0" \
"oniguruma-dev=6.9.9-r0" \
"zip=3.0-r12"
RUN docker-php-ext-configure gd \
......@@ -43,10 +52,10 @@ RUN docker-php-ext-install -j"$(nproc)" \
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN curl -sS https://getcomposer.org/installer | \
php -- --version=2.5.8 --install-dir=/usr/local/bin --filename=composer
php -- --version=2.7.1 --install-dir=/usr/local/bin --filename=composer
# Installe et paramétrage XDebug
RUN pecl install xdebug-3.2.1 \
RUN pecl install xdebug-3.3.1 \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.mode=debug,coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# && echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
......
# -*- coding: utf-8 -*-
FROM php:8.2.7-fpm-alpine3.18
FROM php:8.3.3-fpm-alpine3.19
LABEL authors="Nicolas Béjean <nicolas@bejean.fr>"
LABEL company="Béjean Développement"
LABEL website="www.bejean.eu"
LABEL version="1.1"
LABEL version="1.2"
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
......@@ -13,18 +13,27 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Permet d'installer les dépendances nécessaires à PECL
RUN apk --no-cache --no-progress upgrade > /dev/null \
&& apk --no-cache --no-progress add \
$PHPIZE_DEPS \
"curl=8.1.2-r0" \
"freetype-dev=2.13.0-r5" \
"git=2.40.1-r0" \
"gzip=1.12-r1" \
"libjpeg-turbo-dev=2.1.5.1-r3" \
"libpng-dev=1.6.39-r3" \
"libwebp-dev=1.3.0-r2" \
"libzip-dev=1.9.2-r2" \
"linux-headers=6.3-r0" \
"mysql-client=10.11.4-r0" \
"oniguruma-dev=6.9.8-r1" \
"autoconf=2.71-r2" \
"dpkg-dev=1.22.1-r0" \
"dpkg=1.22.1-r0" \
"file=5.45-r1" \
"g++=13.2.1_git20231014-r0" \
"gcc=13.2.1_git20231014-r0" \
"libc-dev=0.7.2-r5" \
"make=4.4.1-r2" \
"pkgconf=2.1.0-r0" \
"re2c=3.1-r0" \
"curl=8.5.0-r0" \
"freetype-dev=2.13.2-r0" \
"git=2.43.0-r0" \
"gzip=1.13-r0" \
"libjpeg-turbo-dev=3.0.1-r0" \
"libpng-dev=1.6.40-r0" \
"libwebp-dev=1.3.2-r0" \
"libzip-dev=1.10.1-r0" \
"linux-headers=6.5-r0" \
"mysql-client=10.11.6-r0" \
"oniguruma-dev=6.9.9-r0" \
"zip=3.0-r12"
RUN docker-php-ext-configure gd \
......@@ -43,10 +52,10 @@ RUN docker-php-ext-install -j"$(nproc)" \
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN curl -sS https://getcomposer.org/installer | \
php -- --version=2.5.8 --install-dir=/usr/local/bin --filename=composer
php -- --version=2.7.1 --install-dir=/usr/local/bin --filename=composer
# Installe et paramétrage XDebug
RUN pecl install xdebug-3.2.1 \
RUN pecl install xdebug-3.3.1 \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.mode=debug,coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# && echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
......
......@@ -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]
......@@ -14,5 +14,8 @@ trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4
[*.{js,vue}]
indent_size = 2
\ No newline at end of file
......@@ -3,12 +3,24 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
DEBUGBAR_ENABLED=false
APP_URL=http://localhost
APP_TIMEZONE=UTC
APP_URL=http://localhost:8000
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_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
......@@ -16,15 +28,22 @@ DB_DATABASE=laravel
DB_USERNAME=laravel
DB_PASSWORD=laravel
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
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
......@@ -38,16 +57,10 @@ MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="mon@email.com"
MAIL_FROM_NAME="${APP_NAME}"
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
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}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"
/.phpunit.cache
/node_modules
/public/build
/public/hot
......@@ -6,11 +7,14 @@
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
/lang/php_en.json
# Changelog
## [1.7.2] - 2024-03-14
### Ajout
- Ajout de la commande Hadolint dans le fichier `Makefile`
- Ajout de la gestion i18n dans VueJS
### Modification & Mise à jour
- Mise à jour des images Docker pour Laravel 11
- Mise à jour des paquets Laravel en version 11
- Remplacement de MySQL par MariaDB
## [1.6.2] - 2023-11-10
### Modification & Mise à jour
......
......@@ -52,3 +52,7 @@ update:
init:
bin/artisan db:wipe
bin/artisan migrate --seed
.PHONY: docker-lint
docker-lint:
docker run --rm -i hadolint/hadolint < .docker/*.Dockerfile
# Modèle de base pour Laravel 10.13
Ce modèle de base est composé de Laravel 10.13, VueJS 3.3, Vite 4.3, TailwindCSS 3.3 et PestPHP.
Ce modèle de base est composé de Laravel 11.0, VueJS 3.3, Vite 4.3, TailwindCSS 3.3 et PestPHP.
## Prérequis
......@@ -25,7 +25,7 @@ ## Déploiement
Une fois les conteneurs exécutés, vous devez installer les dépendances avec la commande :
```bash
bin/composer install && npm install
bin/composer install && pnpm install
```
Pour terminer, vous devez créer une nouvelle clé de chiffrement pour l'application avec la commande :
......@@ -40,8 +40,8 @@ ## Configuration
## Utilisation
Pour développer votre projet avec le modèle, vous deveez lancer les commandes :
Pour développer votre projet avec le modèle, vous devez lancer les commandes :
```bash
bin/docker up -d && npm run dev
bin/docker up -d && pnpm dev
```
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
<?php
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
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>>
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array<string, class-string|string>
*/
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,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array<int, string>
*/
protected $except = [
//
];
}
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array<int, string>
*/
protected $except = [
//
];
}
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @param string|null ...$guards
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next, ...$guards)
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);
}
}
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
}
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware
{
/**
* Get the host patterns that should be trusted.
*
* @return array<int, string|null>
*/
public function hosts()
{
return [
$this->allSubdomainsOfApplicationUrl(),
];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment