Skip to content

Commit 1ab9747

Browse files
committed
update to laravel 8
1 parent 3e363d9 commit 1ab9747

15 files changed

+229
-375
lines changed

Diff for: .env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://localhost
6-
APP_PROJECT_VERSION=7
6+
APP_PROJECT_VERSION=8
77

88
LOG_CHANNEL=stack
99

Diff for: README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Laravel Auth
22

3-
#### Laravel Auth is a Complete Build of Laravel 7 with Email Registration Verification, Social Authentication, User Roles and Permissions, User Profiles, and Admin restricted user management system. Built on Bootstrap 4.
3+
#### Laravel Auth is a Complete Build of Laravel 8 with Email Registration Verification, Social Authentication, User Roles and Permissions, User Profiles, and Admin restricted user management system. Built on Bootstrap 4.
44
[![Build Status](https://travis-ci.org/jeremykenedy/laravel-auth.svg?branch=master)](https://travis-ci.org/jeremykenedy/laravel-auth)
55
[![StyleCI](https://styleci.io/repos/44714043/shield?branch=master)](https://styleci.io/repos/44714043)
66
[![Build Status](https://scrutinizer-ci.com/g/jeremykenedy/laravel-auth/badges/build.png?b=master)](https://scrutinizer-ci.com/g/jeremykenedy/laravel-auth/build-status/master)
@@ -47,14 +47,14 @@
4747
- [Contributors](#Contributors)
4848

4949
### About
50-
Laravel 7 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. Uses official [Bootstrap 4](https://getbootstrap.com). This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. Project can be stood up in minutes.
50+
Laravel 8 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. Uses official [Bootstrap 4](https://getbootstrap.com). This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. Project can be stood up in minutes.
5151

5252
### Features
53-
#### A [Laravel](https://laravel.com/) 7.x with [Bootstrap](https://getbootstrap.com) 4.x project.
53+
#### A [Laravel](https://laravel.com/) 8.x with [Bootstrap](https://getbootstrap.com) 4.x project.
5454

5555
| Laravel Auth Features |
5656
| :------------ |
57-
|Built on [Laravel](https://laravel.com/) 7|
57+
|Built on [Laravel](https://laravel.com/) 8|
5858
|Built on [Bootstrap](https://getbootstrap.com/) 4|
5959
|Uses [MySQL](https://github.com/mysql) Database (can be changed)|
6060
|Uses [Artisan](https://laravel.com/docs/master/artisan) to manage database migration, schema creations, and create/publish page controller templates|
@@ -595,6 +595,7 @@ INSTAGRAM_REDIRECT_URI=https://YOURWEBURLHERE.COM/social/handle/instagram
595595
* https://laravel.com/docs/master/errors
596596

597597
###### Updates:
598+
* Update to Laravel 8
598599
* Update to Laravel 7 [See changes in this PR](https://github.com/jeremykenedy/laravel-auth/pull/348/files)
599600
* Update to Laravel 6
600601
* Update to Laravel 5.8

Diff for: app/Providers/AppServiceProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class AppServiceProvider extends ServiceProvider
1616
public function boot()
1717
{
1818
//Paginator::useBootstrapThree();
19+
Paginator::useBootstrap();
1920
Schema::defaultStringLength(191);
2021
}
2122

Diff for: app/Providers/RouteServiceProvider.php

+23-41
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,31 @@
22

33
namespace App\Providers;
44

5+
use Illuminate\Cache\RateLimiting\Limit;
56
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
7+
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\RateLimiter;
69
use Illuminate\Support\Facades\Route;
710

811
class RouteServiceProvider extends ServiceProvider
912
{
1013
/**
11-
* This namespace is applied to your controller routes.
14+
* The path to the "home" route for your application.
1215
*
13-
* In addition, it is set as the URL generator's root namespace.
16+
* This is used by Laravel authentication to redirect users after login.
1417
*
1518
* @var string
1619
*/
17-
protected $namespace = 'App\Http\Controllers';
20+
public const HOME = '/home';
1821

1922
/**
20-
* The path to the "home" route for your application.
23+
* If specified, this namespace is automatically applied to your controller routes.
24+
*
25+
* In addition, it is set as the URL generator's root namespace.
2126
*
2227
* @var string
2328
*/
24-
// public const HOME = '/home';
29+
protected $namespace = 'App\Http\Controllers';
2530

2631
/**
2732
* Define your route model bindings, pattern filters, etc.
@@ -30,51 +35,28 @@ class RouteServiceProvider extends ServiceProvider
3035
*/
3136
public function boot()
3237
{
33-
//
34-
35-
parent::boot();
36-
}
37-
38-
/**
39-
* Define the routes for the application.
40-
*
41-
* @return void
42-
*/
43-
public function map()
44-
{
45-
$this->mapApiRoutes();
38+
$this->configureRateLimiting();
4639

47-
$this->mapWebRoutes();
4840

49-
//
50-
}
51-
52-
/**
53-
* Define the "web" routes for the application.
54-
*
55-
* These routes all receive session state, CSRF protection, etc.
56-
*
57-
* @return void
58-
*/
59-
protected function mapWebRoutes()
60-
{
61-
Route::middleware('web')
62-
->namespace($this->namespace)
41+
$this->routes(function () {
42+
Route::middleware('web')
6343
->group(base_path('routes/web.php'));
44+
45+
Route::prefix('api')
46+
->middleware('api')
47+
->group(base_path('routes/api.php'));
48+
});
6449
}
6550

6651
/**
67-
* Define the "api" routes for the application.
68-
*
69-
* These routes are typically stateless.
52+
* Configure the rate limiters for the application.
7053
*
7154
* @return void
7255
*/
73-
protected function mapApiRoutes()
56+
protected function configureRateLimiting()
7457
{
75-
Route::prefix('api')
76-
->middleware('api')
77-
->namespace($this->namespace)
78-
->group(base_path('routes/api.php'));
58+
RateLimiter::for('api', function (Request $request) {
59+
return Limit::perMinute(60);
60+
});
7961
}
8062
}

Diff for: composer.json

+20-14
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,56 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": "^7.2.5",
11+
"php": "^7.3",
1212
"ext-intl": "*",
1313
"creativeorange/gravatar": "^1.0",
1414
"doctrine/dbal": "^2.10",
1515
"fideloper/proxy": "^4.2",
16-
"fruitcake/laravel-cors": "^1.0",
16+
"fruitcake/laravel-cors": "^2.0",
1717
"google/recaptcha": "^1.2",
18-
"guzzlehttp/guzzle": "^6.3",
18+
"guzzlehttp/guzzle": "^7.0.1",
1919
"intervention/image": "^2.5",
2020
"jaybizzle/laravel-crawler-detect": "^1.2",
21-
"jeremykenedy/laravel-blocker": "^2.4",
21+
"jeremykenedy/laravel-blocker": "^2.6",
2222
"jeremykenedy/laravel-exception-notifier": "1.2",
2323
"jeremykenedy/laravel-https": "^1.2",
2424
"jeremykenedy/laravel-logger": "^3.6",
2525
"jeremykenedy/laravel-phpinfo": "^1.2",
26-
"jeremykenedy/laravel-roles": "^3.1",
27-
"jeremykenedy/laravel2step": "^1.8",
26+
"jeremykenedy/laravel-roles": "^3.5",
27+
"jeremykenedy/laravel2step": "^2.0",
2828
"jeremykenedy/uuid": "^3.1",
29-
"laravel/framework": "^7.0",
29+
"laravel/framework": "^8.0",
3030
"laravel/helpers": "^1.2",
31-
"laravel/socialite": "^4.3",
31+
"laravel/socialite": "^5.0",
3232
"laravel/tinker": "^2.0",
3333
"laravel/ui": "^2.0",
3434
"laravelcollective/html": "^6.1",
3535
"pusher/pusher-php-server": "^4.1",
3636
"rap2hpoutre/laravel-log-viewer": "^1.4",
37-
"shvetsgroup/laravel-email-database-log": "^1.4",
37+
"shvetsgroup/laravel-email-database-log": "^1.5",
3838
"socialiteproviders/37signals": "^3.0",
39-
"socialiteproviders/generators": "^4.6",
39+
"socialiteproviders/generators": "^4.7",
4040
"socialiteproviders/instagram": "^3.0",
4141
"socialiteproviders/linkedin": "^3.1",
4242
"socialiteproviders/twitch": "^5.1",
4343
"socialiteproviders/youtube": "^3.0"
4444
},
4545
"require-dev": {
4646
"barryvdh/laravel-debugbar": "^3.2",
47-
"facade/ignition": "^2.0",
47+
"facade/ignition": "^2.3.6",
4848
"fzaninotto/faker": "^1.9.1",
4949
"mockery/mockery": "^1.3.1",
50-
"nunomaduro/collision": "^4.1",
51-
"phpunit/phpunit": "^8.5"
50+
"nunomaduro/collision": "^5.0",
51+
"phpunit/phpunit": "^9.3"
5252
},
5353
"repositories": [
5454
{
5555
"type": "vcs",
5656
"url": "https://github.com/jeremykenedy/Generators-1.git"
57+
},
58+
{
59+
"type": "vcs",
60+
"url": "https://github.com/jeremykenedy/laravel-email-database-log.git"
5761
}
5862
],
5963
"config": {
@@ -72,7 +76,9 @@
7276
"database/factories"
7377
],
7478
"psr-4": {
75-
"App\\": "app/"
79+
"App\\": "app/",
80+
"Database\\Factories\\": "database/factories/",
81+
"Database\\Seeders\\": "database/seeders/"
7682
}
7783
},
7884
"autoload-dev": {

Diff for: config/roles.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@
142142
'tooltipsEnabled' => env('ROLES_GUI_TOOLTIPS_ENABLED', true),
143143

144144
// jQuery
145-
'enablejQueryCDN' => env('ROLES_GUI_JQUERY_CDN_ENABLED', true),
146-
'JQueryCDN' => env('ROLES_GUI_JQUERY_CDN_URL', 'https://code.jquery.com/jquery-3.3.1.min.js'),
145+
'enablejQueryCDN' => env('ROLES_GUI_JQUERY_CDN_ENABLED', true), // You may need to change this if you compile and include jquery
146+
'JQueryCDN' => env('ROLES_GUI_JQUERY_CDN_URL', 'https://code.jquery.com/jquery-3.5.1.min.js'),
147147

148148
// Selectize JS
149149
'enableSelectizeJsCDN' => env('ROLES_GUI_SELECTIZEJS_CDN_ENABLED', true),

Diff for: public/index.php

+22-27
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,55 @@
11
<?php
22

3-
/**
4-
* Laravel - A PHP Framework For Web Artisans
5-
*
6-
* @package Laravel
7-
* @author Taylor Otwell <taylor@laravel.com>
8-
*/
3+
use Illuminate\Contracts\Http\Kernel;
4+
use Illuminate\Http\Request;
95

106
define('LARAVEL_START', microtime(true));
117

128
/*
139
|--------------------------------------------------------------------------
14-
| Register The Auto Loader
10+
| Check If Application Is Under Maintenance
1511
|--------------------------------------------------------------------------
1612
|
17-
| Composer provides a convenient, automatically generated class loader for
18-
| our application. We just need to utilize it! We'll simply require it
19-
| into the script here so that we don't have to worry about manual
20-
| loading any of our classes later on. It feels great to relax.
13+
| If the application is maintenance / demo mode via the "down" command we
14+
| will require this file so that any prerendered template can be shown
15+
| instead of starting the framework, which could cause an exception.
2116
|
2217
*/
2318

24-
require __DIR__.'/../vendor/autoload.php';
19+
if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
20+
require __DIR__.'/../storage/framework/maintenance.php';
21+
}
2522

2623
/*
2724
|--------------------------------------------------------------------------
28-
| Turn On The Lights
25+
| Register The Auto Loader
2926
|--------------------------------------------------------------------------
3027
|
31-
| We need to illuminate PHP development, so let us turn on the lights.
32-
| This bootstraps the framework and gets it ready for use, then it
33-
| will load up this application so that we can run it and send
34-
| the responses back to the browser and delight our users.
28+
| Composer provides a convenient, automatically generated class loader for
29+
| this application. We just need to utilize it! We'll simply require it
30+
| into the script here so we don't need to manually load our classes.
3531
|
3632
*/
3733

38-
$app = require_once __DIR__.'/../bootstrap/app.php';
34+
require __DIR__.'/../vendor/autoload.php';
3935

4036
/*
4137
|--------------------------------------------------------------------------
4238
| Run The Application
4339
|--------------------------------------------------------------------------
4440
|
45-
| Once we have the application, we can handle the incoming request
46-
| through the kernel, and send the associated response back to
47-
| the client's browser allowing them to enjoy the creative
48-
| and wonderful application we have prepared for them.
41+
| Once we have the application, we can handle the incoming request using
42+
| the application's HTTP kernel. Then, we will send the response back
43+
| to this client's browser, allowing them to enjoy our application.
4944
|
5045
*/
5146

52-
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
47+
$app = require_once __DIR__.'/../bootstrap/app.php';
5348

54-
$response = $kernel->handle(
55-
$request = Illuminate\Http\Request::capture()
56-
);
49+
$kernel = $app->make(Kernel::class);
5750

58-
$response->send();
51+
$response = tap($kernel->handle(
52+
$request = Request::capture()
53+
))->send();
5954

6055
$kernel->terminate($request, $response);

Diff for: public/web.config

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!--
2+
Rewrites requires Microsoft URL Rewrite Module for IIS
3+
Download: https://www.microsoft.com/en-us/download/details.aspx?id=47337
4+
Debug Help: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
5+
-->
16
<configuration>
27
<system.webServer>
38
<rewrite>

Diff for: resources/views/errors/401.blade.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@extends('errors::minimal')
2+
3+
@section('title', __('Unauthorized'))
4+
@section('code', '401')
5+
@section('message', __('Unauthorized'))

Diff for: resources/views/errors/403.blade.php

+4-46
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,5 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<title>403 | Forbidden.</title>
1+
@extends('errors::minimal')
52

6-
<link href="//fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
7-
8-
<style>
9-
html, body {
10-
height: 100%;
11-
}
12-
13-
body {
14-
margin: 0;
15-
padding: 0;
16-
width: 100%;
17-
color: #B0BEC5;
18-
display: table;
19-
font-weight: 100;
20-
font-family: 'Lato';
21-
}
22-
23-
.container {
24-
text-align: center;
25-
display: table-cell;
26-
vertical-align: middle;
27-
}
28-
29-
.content {
30-
text-align: center;
31-
display: inline-block;
32-
}
33-
34-
.title {
35-
font-size: 72px;
36-
margin-bottom: 40px;
37-
}
38-
</style>
39-
</head>
40-
<body>
41-
<div class="container">
42-
<div class="content">
43-
<div class="title">Forbidden.</div>
44-
</div>
45-
</div>
46-
</body>
47-
</html>
3+
@section('title', __('Forbidden'))
4+
@section('code', '403')
5+
@section('message', __($exception->getMessage() ?: 'Forbidden'))

0 commit comments

Comments
 (0)