Skip to content

Commit 07a092a

Browse files
authored
Merge pull request #73 from tuxonice/upgrade/laravel-8
Upgrade to Laravel 9
2 parents 4355a6e + 8919824 commit 07a092a

File tree

257 files changed

+150647
-6502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+150647
-6502
lines changed

.env.example

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ APP_DEBUG=true
55
APP_URL=http://localhost
66

77
LOG_CHANNEL=stack
8+
LOG_LEVEL=debug
89

910
DB_CONNECTION=mysql
1011
DB_HOST=127.0.0.1
@@ -19,19 +20,20 @@ QUEUE_CONNECTION=sync
1920
SESSION_DRIVER=file
2021
SESSION_LIFETIME=120
2122

23+
MEMCACHED_HOST=127.0.0.1
24+
2225
REDIS_HOST=127.0.0.1
2326
REDIS_PASSWORD=null
2427
REDIS_PORT=6379
2528

26-
MAIL_DRIVER=smtp
27-
MAIL_HOST=smtp.mailtrap.io
28-
MAIL_PORT=2525
29+
MAIL_MAILER=smtp
30+
MAIL_HOST=mailhog
31+
MAIL_PORT=1025
2932
MAIL_USERNAME=null
3033
MAIL_PASSWORD=null
3134
MAIL_ENCRYPTION=null
3235
MAIL_FROM_ADDRESS=null
3336
MAIL_FROM_NAME="${APP_NAME}"
34-
3537

3638
AWS_ACCESS_KEY_ID=
3739
AWS_SECRET_ACCESS_KEY=
@@ -45,4 +47,3 @@ PUSHER_APP_CLUSTER=mt1
4547

4648
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
4749
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
48-

.github/workflows/laravel.yml renamed to .github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Laravel
1+
name: tests
22

33
on: [push]
44

@@ -10,9 +10,9 @@ jobs:
1010
- name: Copy .env
1111
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
1212
- name: Setup PHP
13-
uses: shivammathur/setup-php@v2
13+
uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
1414
with:
15-
php-version: '7.4'
15+
php-version: '8.1'
1616
- name: Install Dependencies
1717
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
1818
- name: Generate key

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
.idea
21
/node_modules
32
/public/hot
43
/public/storage
4+
/public/js
5+
/public/css
6+
/public/img
7+
/public/webfonts
58
/storage/*.key
69
/vendor
710
.env
811
.env.backup
912
.phpunit.result.cache
13+
docker-compose.override.yml
1014
Homestead.json
1115
Homestead.yaml
1216
npm-debug.log
1317
yarn-error.log
14-
/_db_backup
18+
.idea

.styleci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
php:
22
preset: laravel
33
disabled:
4-
- unused_use
4+
- no_unused_imports
55
finder:
66
not-name:
77
- index.php

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11

2-
![Laravel](https://github.com/tuxonice/pixel-home/workflows/Laravel/badge.svg)
2+
![Laravel](https://github.com/tuxonice/pixel-home/workflows/tests/badge.svg?branch=upgrade/laravel-8)
33

44
## About Pixel Home
55

66
UI for Shelly devices
77

88
This is a work in progress project
9-
10-

app/Console/Kernel.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Illuminate\Console\Scheduling\Schedule;
66
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7-
use App\Console\Commands\UpdateEventData;
87

98
class Kernel extends ConsoleKernel
109
{
@@ -25,8 +24,7 @@ class Kernel extends ConsoleKernel
2524
*/
2625
protected function schedule(Schedule $schedule)
2726
{
28-
// $schedule->command('inspire')
29-
// ->hourly();
27+
// $schedule->command('inspire')->hourly();
3028
}
3129

3230
/**

app/Exceptions/Handler.php

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,20 @@ class Handler extends ExceptionHandler
2222
* @var array
2323
*/
2424
protected $dontFlash = [
25+
'current_password',
2526
'password',
2627
'password_confirmation',
2728
];
2829

2930
/**
30-
* Report or log an exception.
31+
* Register the exception handling callbacks for the application.
3132
*
32-
* @param \Exception $exception
3333
* @return void
34-
*
35-
* @throws \Exception
36-
*/
37-
public function report(Throwable $exception)
38-
{
39-
parent::report($exception);
40-
}
41-
42-
/**
43-
* Render an exception into an HTTP response.
44-
*
45-
* @param \Illuminate\Http\Request $request
46-
* @param \Exception $exception
47-
* @return \Symfony\Component\HttpFoundation\Response
48-
*
49-
* @throws \Exception
5034
*/
51-
public function render($request, Throwable $exception)
35+
public function register()
5236
{
53-
return parent::render($request, $exception);
37+
$this->reportable(function (Throwable $e) {
38+
//
39+
});
5440
}
5541
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Http\Requests\Auth\LoginRequest;
7+
use App\Providers\RouteServiceProvider;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Auth;
10+
11+
class AuthenticatedSessionController extends Controller
12+
{
13+
/**
14+
* Display the login view.
15+
*
16+
* @return \Illuminate\View\View
17+
*/
18+
public function create()
19+
{
20+
return view('auth.login');
21+
}
22+
23+
/**
24+
* Handle an incoming authentication request.
25+
*
26+
* @param \App\Http\Requests\Auth\LoginRequest $request
27+
* @return \Illuminate\Http\RedirectResponse
28+
*/
29+
public function store(LoginRequest $request)
30+
{
31+
$request->authenticate();
32+
33+
$request->session()->regenerate();
34+
35+
return redirect()->intended(RouteServiceProvider::HOME);
36+
}
37+
38+
/**
39+
* Destroy an authenticated session.
40+
*
41+
* @param \Illuminate\Http\Request $request
42+
* @return \Illuminate\Http\RedirectResponse
43+
*/
44+
public function destroy(Request $request)
45+
{
46+
Auth::guard('web')->logout();
47+
48+
$request->session()->invalidate();
49+
50+
$request->session()->regenerateToken();
51+
52+
return redirect('/');
53+
}
54+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\Request;
8+
use Illuminate\Support\Facades\Auth;
9+
use Illuminate\Validation\ValidationException;
10+
11+
class ConfirmablePasswordController extends Controller
12+
{
13+
/**
14+
* Show the confirm password view.
15+
*
16+
* @param \Illuminate\Http\Request $request
17+
* @return \Illuminate\View\View
18+
*/
19+
public function show(Request $request)
20+
{
21+
return view('auth.confirm-password');
22+
}
23+
24+
/**
25+
* Confirm the user's password.
26+
*
27+
* @param \Illuminate\Http\Request $request
28+
* @return mixed
29+
*/
30+
public function store(Request $request)
31+
{
32+
if (! Auth::guard('web')->validate([
33+
'email' => $request->user()->email,
34+
'password' => $request->password,
35+
])) {
36+
throw ValidationException::withMessages([
37+
'password' => __('auth.password'),
38+
]);
39+
}
40+
41+
$request->session()->put('auth.password_confirmed_at', time());
42+
43+
return redirect()->intended(RouteServiceProvider::HOME);
44+
}
45+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Http\Request;
8+
9+
class EmailVerificationNotificationController extends Controller
10+
{
11+
/**
12+
* Send a new email verification notification.
13+
*
14+
* @param \Illuminate\Http\Request $request
15+
* @return \Illuminate\Http\Response
16+
*/
17+
public function store(Request $request)
18+
{
19+
if ($request->user()->hasVerifiedEmail()) {
20+
return redirect()->intended(RouteServiceProvider::HOME);
21+
}
22+
23+
$request->user()->sendEmailVerificationNotification();
24+
25+
return back()->with('status', 'verification-link-sent');
26+
}
27+
}

0 commit comments

Comments
 (0)