Skip to content

Commit 5e11260

Browse files
authored
Merge pull request cretueusebiu#131 from cretueusebiu/next
Next
2 parents da146ab + 9ef9ee0 commit 5e11260

File tree

85 files changed

+9927
-7275
lines changed

Some content is hidden

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

85 files changed

+9927
-7275
lines changed

Diff for: .editorconfig

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
root = true
22

33
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
47
indent_style = space
58
indent_size = 4
6-
end_of_line = lf
7-
charset = utf-8
89
trim_trailing_whitespace = true
9-
insert_final_newline = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
1313

14-
[*.{vue,js,json,html,scss,blade.php}]
15-
indent_style = space
14+
[*.{vue,js,json,html,scss,blade.php,yml}]
1615
indent_size = 2

Diff for: .env.example

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ APP_NAME="Laravel Nuxt"
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_URL=http://localhost
5+
APP_LOG_LEVEL=debug
6+
APP_URL=http://localhost:8000
67

78
LOG_CHANNEL=stack
9+
LOG_LEVEL=debug
810

911
DB_CONNECTION=mysql
1012
DB_HOST=127.0.0.1
@@ -23,12 +25,14 @@ REDIS_HOST=127.0.0.1
2325
REDIS_PASSWORD=null
2426
REDIS_PORT=6379
2527

26-
MAIL_DRIVER=smtp
28+
MAIL_MAILER=smtp
2729
MAIL_HOST=smtp.mailtrap.io
2830
MAIL_PORT=2525
2931
MAIL_USERNAME=null
3032
MAIL_PASSWORD=null
3133
MAIL_ENCRYPTION=null
34+
MAIL_FROM_ADDRESS=null
35+
MAIL_FROM_NAME="${APP_NAME}"
3236

3337
AWS_ACCESS_KEY_ID=
3438
AWS_SECRET_ACCESS_KEY=
@@ -40,4 +44,8 @@ PUSHER_APP_KEY=
4044
PUSHER_APP_SECRET=
4145
PUSHER_APP_CLUSTER=mt1
4246

47+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
48+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
49+
4350
JWT_TTL=1440
51+
JWT_SECRET=

Diff for: .eslintrc

-13
This file was deleted.

Diff for: .eslintrc.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
parser: '@babel/eslint-parser',
5+
sourceType: 'module',
6+
requireConfigFile: false
7+
},
8+
extends: [
9+
'@nuxtjs'
10+
],
11+
rules: {
12+
'vue/max-attributes-per-line': 'off'
13+
}
14+
}

Diff for: .gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
CHANGELOG.md export-ignore
66
README.md export-ignore
77
.travis.yml export-ignore
8+
.env.dusk.local export-ignore
9+
.env.dusk.testing export-ignore

Diff for: .github/workflows/tests.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Get Composer cache directory
17+
id: composer-cache
18+
run: |
19+
echo "::set-output name=dir::$(composer config cache-files-dir)"
20+
21+
- uses: actions/cache@v2
22+
with:
23+
path: ${{ steps.composer-cache.outputs.dir }}
24+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-composer-
27+
28+
- uses: actions/cache@v2
29+
with:
30+
path: ~/.npm
31+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-node-
34+
35+
- name: Install composer dependencies
36+
run: composer install -q --no-ansi --no-interaction --no-progress --no-suggest --prefer-dist --optimize-autoloader
37+
38+
- name: Directory permissions
39+
run: chmod -R 777 storage bootstrap/cache
40+
41+
- name: Run tests (Unit and Feature)
42+
run: vendor/bin/phpunit

Diff for: .styleci.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
php:
2+
preset: laravel
3+
disabled:
4+
- no_unused_imports
5+
finder:
6+
not-name:
7+
- index.php
8+
- server.php
9+
js:
10+
finder:
11+
not-name:
12+
- webpack.mix.js
13+
css: true

Diff for: .travis.yml

-14
This file was deleted.

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 3.0.0 - 2020-11-28
4+
5+
- Upgrade to Laravel 8
6+
- Update dependencies
7+
- Catch validation errors [#105](https://github.com/cretueusebiu/laravel-nuxt/pull/105)
8+
39
## 2.2.0 - 2020-01-12
410

511
- Upgrade to Nuxt 2.11

Diff for: README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Laravel-Nuxt
22

3-
<a href="https://travis-ci.org/cretueusebiu/laravel-nuxt"><img src="https://travis-ci.org/cretueusebiu/laravel-nuxt.svg?branch=master" alt="Build Status"></a>
3+
<a href="https://github.com/cretueusebiu/laravel-nuxt/actions"><img src="https://github.com/cretueusebiu/laravel-nuxt/workflows/tests/badge.svg" alt="Build Status"></a>
44
<a href="https://packagist.org/packages/cretueusebiu/laravel-nuxt"><img src="https://poser.pugx.org/cretueusebiu/laravel-nuxt/d/total.svg" alt="Total Downloads"></a>
55
<a href="https://packagist.org/packages/cretueusebiu/laravel-nuxt"><img src="https://poser.pugx.org/cretueusebiu/laravel-nuxt/v/stable.svg" alt="Latest Stable Version"></a>
66

@@ -12,8 +12,8 @@
1212

1313
## Features
1414

15-
- Nuxt 2.11
16-
- Laravel 6
15+
- Nuxt 2
16+
- Laravel 8
1717
- SPA or SSR
1818
- Socialite integration
1919
- VueI18n + ESlint + Bootstrap 4 + Font Awesome 5
@@ -22,7 +22,7 @@
2222
## Installation
2323

2424
- `composer create-project --prefer-dist cretueusebiu/laravel-nuxt`
25-
- Edit `.env` to set your database connection details and `APP_URL` (the url to your Laravel application)
25+
- Edit `.env` and set your database connection details
2626
- (When installed via git clone or download, run `php artisan key:generate` and `php artisan jwt:secret`)
2727
- `php artisan migrate`
2828
- `npm install`
@@ -32,22 +32,24 @@
3232
### Development
3333

3434
```bash
35+
# start Laravel
36+
php artisan serve
37+
38+
# start Nuxt
3539
npm run dev
3640
```
3741

38-
You can access your application at `http://localhost:3000`.
42+
Access your application at `http://localhost:3000`.
3943

4044
### Production
4145

4246
```bash
4347
npm run build
4448
```
4549

46-
You can access your application the url you set `APP_URL` to.
47-
4850
### Enable SSR
4951

50-
- Remove `mode: 'spa'` and `'~plugins/nuxt-client-init'` from `client/nuxt.config.js`
52+
- Edit `client/nuxt.config.js` and set `ssr: true`
5153
- Edit `.env` to set `APP_URL=http://api.example.com` and `CLIENT_URL=http://example.com`
5254
- Run `npm run build` and `npm run start`
5355

Diff for: app/Console/Kernel.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class Kernel extends ConsoleKernel
2424
*/
2525
protected function schedule(Schedule $schedule)
2626
{
27-
// $schedule->command('inspire')
28-
// ->hourly();
27+
// $schedule->command('inspire')->hourly();
2928
}
3029

3130
/**

Diff for: app/Exceptions/Handler.php

-26
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Exceptions;
44

5-
use Exception;
65
use Illuminate\Auth\AuthenticationException;
76
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
87

@@ -27,31 +26,6 @@ class Handler extends ExceptionHandler
2726
'password_confirmation',
2827
];
2928

30-
/**
31-
* Report or log an exception.
32-
*
33-
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
34-
*
35-
* @param \Exception $exception
36-
* @return void
37-
*/
38-
public function report(Exception $exception)
39-
{
40-
parent::report($exception);
41-
}
42-
43-
/**
44-
* Render an exception into an HTTP response.
45-
*
46-
* @param \Illuminate\Http\Request $request
47-
* @param \Exception $exception
48-
* @return \Illuminate\Http\Response
49-
*/
50-
public function render($request, Exception $exception)
51-
{
52-
return parent::render($request, $exception);
53-
}
54-
5529
/**
5630
* Convert an authentication exception into a response.
5731
*

Diff for: app/Http/Controllers/Auth/OAuthController.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use App\Exceptions\EmailTakenException;
66
use App\Http\Controllers\Controller;
7-
use App\OAuthProvider;
8-
use App\User;
7+
use App\Models\OAuthProvider;
8+
use App\Models\User;
99
use Illuminate\Foundation\Auth\AuthenticatesUsers;
1010
use Laravel\Socialite\Facades\Socialite;
1111

@@ -31,7 +31,7 @@ public function __construct()
3131
* @param string $provider
3232
* @return \Illuminate\Http\RedirectResponse
3333
*/
34-
public function redirectToProvider($provider)
34+
public function redirect($provider)
3535
{
3636
return [
3737
'url' => Socialite::driver($provider)->stateless()->redirect()->getTargetUrl(),
@@ -44,7 +44,7 @@ public function redirectToProvider($provider)
4444
* @param string $driver
4545
* @return \Illuminate\Http\Response
4646
*/
47-
public function handleProviderCallback($provider)
47+
public function handleCallback($provider)
4848
{
4949
$user = Socialite::driver($provider)->stateless()->user();
5050
$user = $this->findOrCreateUser($provider, $user);
@@ -63,7 +63,7 @@ public function handleProviderCallback($provider)
6363
/**
6464
* @param string $provider
6565
* @param \Laravel\Socialite\Contracts\User $sUser
66-
* @return \App\User|false
66+
* @return \App\Models\User
6767
*/
6868
protected function findOrCreateUser($provider, $user)
6969
{
@@ -90,7 +90,7 @@ protected function findOrCreateUser($provider, $user)
9090
/**
9191
* @param string $provider
9292
* @param \Laravel\Socialite\Contracts\User $sUser
93-
* @return \App\User
93+
* @return \App\Models\User
9494
*/
9595
protected function createUser($provider, $sUser)
9696
{

Diff for: app/Http/Controllers/Auth/RegisterController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Http\Controllers\Auth;
44

55
use App\Http\Controllers\Controller;
6-
use App\User;
6+
use App\Models\User;
77
use Illuminate\Contracts\Auth\MustVerifyEmail;
88
use Illuminate\Foundation\Auth\RegistersUsers;
99
use Illuminate\Http\Request;
@@ -49,7 +49,7 @@ protected function validator(array $data)
4949
{
5050
return Validator::make($data, [
5151
'name' => 'required|max:255',
52-
'email' => 'required|email|max:255|unique:users',
52+
'email' => 'required|email:filter|max:255|unique:users',
5353
'password' => 'required|min:6|confirmed',
5454
]);
5555
}

Diff for: app/Http/Controllers/Auth/UserController.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Http\Request;
7+
8+
class UserController extends Controller
9+
{
10+
/**
11+
* Get authenticated user.
12+
*
13+
* @param \Illuminate\Http\Request $request
14+
* @return \Illuminate\Http\JsonResponse
15+
*/
16+
public function current(Request $request)
17+
{
18+
return response()->json($request->user());
19+
}
20+
}

Diff for: app/Http/Controllers/Auth/VerificationController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Http\Controllers\Auth;
44

55
use App\Http\Controllers\Controller;
6-
use App\User;
6+
use App\Models\User;
77
use Illuminate\Auth\Events\Verified;
88
use Illuminate\Http\Request;
99
use Illuminate\Support\Facades\URL;

Diff for: app/Http/Controllers/Settings/PasswordController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PasswordController extends Controller
1616
public function update(Request $request)
1717
{
1818
$this->validate($request, [
19-
'password' => 'required|confirmed|min:8',
19+
'password' => 'required|confirmed|min:6',
2020
]);
2121

2222
$request->user()->update([

0 commit comments

Comments
 (0)