Skip to content

Commit

Permalink
Merge pull request #31 from Barsnes/shift-65963
Browse files Browse the repository at this point in the history
Laravel 6.x Shift
  • Loading branch information
Barsnes authored Jul 8, 2022
2 parents d6ef8c1 + 6867e78 commit e047595
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 47 deletions.
40 changes: 40 additions & 0 deletions app/Http/Controllers/Auth/ConfirmPasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Http\Controllers\Auth;

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

class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/

use ConfirmsPasswords;

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

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
}
10 changes: 0 additions & 10 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,4 @@ class ForgotPasswordController extends Controller
*/

use SendsPasswordResetEmails;

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
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
33 changes: 16 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"andreasindal/laravel-markdown": "^3.0",
"barryvdh/laravel-dompdf": "^0.8.4",
"buglinjo/laravel-webp": "^1.0",
"doctrine/dbal": "^2.9",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.4",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "5.8.*",
"laravelium/feed": "^3.0",
"spatie/laravel-feed": "^2.1",
"spatie/laravel-sitemap": "^5.2"
"php": "^7.2|^8.0",
"andreasindal/laravel-markdown": "^3.1",
"barryvdh/laravel-dompdf": "^1.0",
"buglinjo/laravel-webp": "^2.3",
"doctrine/dbal": "^2.13",
"fideloper/proxy": "^4.4",
"intervention/image": "^2.7",
"laravel/framework": "^6.20",
"laravel/tinker": "^2.5",
"laravelcollective/html": "^6.3",
"laravelium/feed": "^6.0",
"spatie/laravel-feed": "^2.7",
"spatie/laravel-sitemap": "^5.8"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
"phpunit/phpunit": "^8.5.8|^9.3.3",
"fakerphp/faker": "^1.9.1",
"facade/ignition": "^1.16.4"
},
"config": {
"optimize-autoloader": true,
Expand Down
17 changes: 17 additions & 0 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],

'admin' => [
Expand Down Expand Up @@ -79,10 +80,12 @@
'driver' => 'eloquent',
'model' => App\User::class,
],

'admins' => [
'driver' => 'eloquent',
'model' => App\Admin::class,
],

// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
Expand All @@ -109,6 +112,7 @@
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],

'admins' => [
Expand All @@ -118,4 +122,17 @@
],
],

/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/

'password_timeout' => 10800,

];
2 changes: 1 addition & 1 deletion config/broadcasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
'useTLS' => true,
],
],

Expand Down
12 changes: 6 additions & 6 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,27 @@

'redis' => [

'client' => env('REDIS_CLIENT', 'predis'),
'client' => env('REDIS_CLIENT', 'phpredis'),

'options' => [
'cluster' => env('REDIS_CLUSTER', 'predis'),
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],

'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],

'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],

],
Expand Down
3 changes: 2 additions & 1 deletion config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/

Expand All @@ -62,6 +62,7 @@
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],

],
Expand Down
12 changes: 11 additions & 1 deletion config/logging.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;

Expand Down Expand Up @@ -36,7 +37,7 @@
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['daily'],
'channels' => ['single'],
'ignore_exceptions' => false,
],

Expand Down Expand Up @@ -89,6 +90,15 @@
'driver' => 'errorlog',
'level' => 'debug',
],

'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],

'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],

];
4 changes: 2 additions & 2 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "postmark", "log", "array"
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/

Expand Down
1 change: 1 addition & 0 deletions config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
*/

'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
Expand Down
6 changes: 1 addition & 5 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, SparkPost and others. This file provides a sane default
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
Expand All @@ -30,8 +30,4 @@
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],

'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],

];
2 changes: 1 addition & 1 deletion resources/lang/en/passwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
|
*/

'password' => 'Passwords must be at least six characters and match the confirmation.',
'reset' => 'Your password has been reset!',
'sent' => 'We have e-mailed your password reset link!',
'throttled' => 'Please wait before retrying.',
'token' => 'This password reset token is invalid.',
'user' => "We can't find a user with that e-mail address.",

Expand Down
5 changes: 3 additions & 2 deletions resources/lang/en/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
'ends_with' => 'The :attribute must end with one of the following: :values',
'ends_with' => 'The :attribute must end with one of the following: :values.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
Expand Down Expand Up @@ -93,6 +93,7 @@
'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.',
'password' => 'The password is incorrect.',
'present' => 'The :attribute field must be present.',
'regex' => 'The :attribute format is invalid.',
'required' => 'The :attribute field is required.',
Expand All @@ -109,7 +110,7 @@
'string' => 'The :attribute must be :size characters.',
'array' => 'The :attribute must contain :size items.',
],
'starts_with' => 'The :attribute must start with one of the following: :values',
'starts_with' => 'The :attribute must start with one of the following: :values.',
'string' => 'The :attribute must be a string.',
'timezone' => 'The :attribute must be a valid zone.',
'unique' => 'The :attribute has already been taken.',
Expand Down

0 comments on commit e047595

Please sign in to comment.