Skip to content

Commit

Permalink
upgrade to Laravel framework 6.20.22
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkcup authored Apr 19, 2021
1 parent cbc521d commit f28989b
Show file tree
Hide file tree
Showing 32 changed files with 5,568 additions and 3,424 deletions.
14 changes: 11 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Dockerfile
.dockerignore
.git
.env
.gitignore
.git/
.idea/
bootstrap/cache/*
database/*.sqlite
laradock/
node_modules/
storage/app/*
storage/framework/cache/*
storage/framework/sessions/*
storage/framework/views/*
storage/logs/*
vendor/
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.yml]
[*.{yml,yaml}]
indent_size = 2
53 changes: 18 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,61 +1,44 @@
FROM php:7.3-apache
MAINTAINER sinkcup <[email protected]>
FROM php:8.0-apache

WORKDIR /var/www/laravel

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y \
cron \
icu-devtools \
jq \
libfreetype6-dev libicu-dev libjpeg62-turbo-dev libpng-dev libsasl2-dev libssl-dev libwebp-dev libxpm-dev libzip-dev \
nodejs \
unzip \
zlib1g-dev
zlib1g-dev \
&& apt-get clean \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
&& yes '' | pecl install redis \
&& docker-php-ext-configure gd --with-freetype-dir --with-gd --with-jpeg-dir --with-png-dir --with-webp-dir --with-xpm-dir --with-zlib-dir \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm \
&& docker-php-ext-install gd intl pdo_mysql zip \
&& docker-php-ext-enable opcache redis
RUN apt-get clean \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /var/www/laravel

COPY composer.json /var/www/laravel/
COPY composer.lock /var/www/laravel/
COPY composer.json composer.lock ./
RUN composer install --no-autoloader --no-scripts --no-dev

# Compiling Assets. uncomment these lines after you install Laravel UI
COPY package.json /var/www/laravel/
COPY package-lock.json /var/www/laravel/
COPY package.json package-lock.json /var/www/laravel/
RUN npm install
COPY resources/js /var/www/laravel/resources/js
COPY resources/sass /var/www/laravel/resources/sass
COPY webpack.mix.js /var/www/laravel/
RUN npm run production

COPY app /var/www/laravel/app
COPY artisan /var/www/laravel/artisan
COPY bootstrap /var/www/laravel/bootstrap
COPY config /var/www/laravel/config
COPY database /var/www/laravel/database
COPY public /var/www/laravel/public
COPY resources /var/www/laravel/resources
COPY routes /var/www/laravel/routes
COPY server.php /var/www/laravel/server.php
COPY storage /var/www/laravel/storage
RUN composer install --optimize-autoloader --no-dev

RUN rm -f public/storage \
&& php artisan storage:link

COPY docker/ /
RUN a2enmod rewrite headers \
&& a2ensite laravel \
&& a2dissite 000-default

COPY . /var/www/laravel/
COPY . /var/www/laravel
RUN composer install --optimize-autoloader --no-dev \
&& npm run production

RUN chown www-data:www-data bootstrap/cache \
&& chown -R www-data:www-data storage/
&& chown -R www-data:www-data storage/ \
&& chmod +x /usr/local/bin/docker-laravel-entrypoint

CMD ["docker-laravel-entrypoint"]
6 changes: 5 additions & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Handler extends ExceptionHandler
*
* @param \Exception $exception
* @return void
*
* @throws \Exception
*/
public function report(Exception $exception)
{
Expand All @@ -42,7 +44,9 @@ public function report(Exception $exception)
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
*/
public function render($request, Exception $exception)
{
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/ConfirmPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;

class ConfirmPasswordController extends Controller
{
use ConfirmsPasswords;

/*
|--------------------------------------------------------------------------
| Confirm Password Controller
Expand All @@ -19,13 +18,14 @@ class ConfirmPasswordController extends Controller
| this trait and override any functions that require customization.
|
*/
use ConfirmsPasswords;

/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = '/home';
protected $redirectTo = RouteServiceProvider::HOME;

/**
* Create a new controller instance.
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

class ForgotPasswordController extends Controller
{
use SendsPasswordResetEmails;

/*
|--------------------------------------------------------------------------
| Password Reset Controller
Expand All @@ -19,4 +17,5 @@ class ForgotPasswordController extends Controller
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers\Auth;

use Random;
use sinkcup\LaravelUiSocialite\Socialite\Controllers\SocialiteLoginController;
use LaravelFans\UiSocialite\Socialite\Controllers\SocialiteLoginController;

class LoginController extends SocialiteLoginController
{
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;

class ResetPasswordController extends Controller
{
use ResetsPasswords;

/*
|--------------------------------------------------------------------------
| Password Reset Controller
Expand All @@ -19,11 +18,12 @@ class ResetPasswordController extends Controller
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;

/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
protected $redirectTo = RouteServiceProvider::HOME;
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use sinkcup\LaravelUiSocialite\SocialAccount;
use LaravelFans\UiSocialite\SocialAccount;
use Validator;

class ProfileController extends Controller
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Settings/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers\Settings;

use sinkcup\LaravelUiSocialite\Socialite\Controllers\Settings\ProfileController as PackageProfileController;
use LaravelFans\UiSocialite\Socialite\Controllers\Settings\ProfileController as PackageProfileController;

class ProfileController extends PackageProfileController
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Kernel extends HttpKernel

'api' => [
'throttle:60,1',
'bindings',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

Expand Down
3 changes: 2 additions & 1 deletion app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Middleware;

use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Support\Facades\Auth;

Expand All @@ -18,7 +19,7 @@ class RedirectIfAuthenticated
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
return redirect(RouteServiceProvider::HOME);
}

return $next($request);
Expand Down
7 changes: 7 additions & 0 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ class RouteServiceProvider extends ServiceProvider
*/
protected $namespace = 'App\Http\Controllers';

/**
* The path to the "home" route for your application.
*
* @var string
*/
public const HOME = '/home';

/**
* Define your route model bindings, pattern filters, etc.
*
Expand Down
21 changes: 11 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@
],
"license": "MIT",
"require": {
"php": "^7.2",
"php": "^7.2.5|^8.0",
"ext-json": "*",
"ext-redis": "*",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0",
"sinkcup/laravel-ui-socialite": "^5.0.4"
"doctrine/dbal": "^2.13",
"fideloper/proxy": "^4.4",
"laravel/framework": "^6.20",
"laravel/tinker": "^2.5",
"laravel-fans/ui-socialite": "^7.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.6",
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.9",
"facade/ignition": "^1.16.4",
"fakerphp/faker": "^1.9.1",
"laravel-fans/docker": "^0.3.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"php-mock/php-mock": "^2.1",
"phpunit/phpunit": "^8.0",
"squizlabs/php_codesniffer": "^3.4"
"phpunit/phpunit": "^8.5.8|^9.3.3",
"squizlabs/php_codesniffer": "^3.6"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading

0 comments on commit f28989b

Please sign in to comment.