Skip to content

Commit 516c584

Browse files
committed
updated to v5.7
1 parent 59a3c13 commit 516c584

File tree

84 files changed

+3526
-58218
lines changed

Some content is hidden

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

84 files changed

+3526
-58218
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2

.env.example

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_LOG_LEVEL=debug
65
APP_URL=http://localhost
76

7+
LOG_CHANNEL=stack
8+
89
DB_CONNECTION=mysql
910
DB_HOST=127.0.0.1
1011
DB_PORT=3306
11-
DB_DATABASE=homestead
12-
DB_USERNAME=homestead
13-
DB_PASSWORD=secret
12+
DB_DATABASE=laravel_api
13+
DB_USERNAME=root
14+
DB_PASSWORD=
1415

1516
BROADCAST_DRIVER=log
1617
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
1719
SESSION_DRIVER=file
18-
QUEUE_DRIVER=sync
20+
SESSION_LIFETIME=120
1921

2022
REDIS_HOST=127.0.0.1
2123
REDIS_PASSWORD=null
@@ -31,3 +33,10 @@ MAIL_ENCRYPTION=null
3133
PUSHER_APP_ID=
3234
PUSHER_APP_KEY=
3335
PUSHER_APP_SECRET=
36+
PUSHER_APP_CLUSTER=mt1
37+
38+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
40+
41+
JWT_SECRET=
42+
JWT_TTL=10080

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
/storage/*.key
55
/vendor
66
/.idea
7+
/.vscode
78
/.vagrant
89
Homestead.json
910
Homestead.yaml
1011
npm-debug.log
1112
yarn-error.log
1213
.env
14+
.phpunit.result.cache

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
init:
2+
composer install
3+
4+
@if [ ! -f .env ];\
5+
then cp .env.example .env;\
6+
echo "Copied from .env.example";\
7+
php artisan key:generate;\
8+
php artisan jwt:secret;\
9+
fi
10+
11+
php artisan migrate:fresh --seed

app/Book.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66

77
class Book extends Model
88
{
9+
/**
10+
* The attributes that are mass assignable.
11+
*
12+
* @var array
13+
*/
14+
915
protected $fillable = ['author', 'description'];
1016
}

app/Exceptions/Handler.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Exceptions;
44

55
use Exception;
6+
use Illuminate\Database\Eloquent\ModelNotFoundException;
67
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
78

89
class Handler extends ExceptionHandler
@@ -29,8 +30,6 @@ class Handler extends ExceptionHandler
2930
/**
3031
* Report or log an exception.
3132
*
32-
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
33-
*
3433
* @param \Exception $exception
3534
* @return void
3635
*/
@@ -48,6 +47,15 @@ public function report(Exception $exception)
4847
*/
4948
public function render($request, Exception $exception)
5049
{
50+
if ($exception instanceof ModelNotFoundException) {
51+
if ($request->ajax()) {
52+
return response()->json([
53+
'error' => true,
54+
'success' => false,
55+
'message' => 'Record Not Found!'
56+
], 404);
57+
}
58+
}
5159
return parent::render($request, $exception);
5260
}
5361
}

app/Http/Controllers/ApiController.php

Lines changed: 0 additions & 93 deletions
This file was deleted.

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\User;
66
use App\Http\Controllers\Controller;
7+
use Illuminate\Support\Facades\Hash;
78
use Illuminate\Support\Facades\Validator;
89
use Illuminate\Foundation\Auth\RegistersUsers;
910

@@ -65,7 +66,7 @@ protected function create(array $data)
6566
return User::create([
6667
'name' => $data['name'],
6768
'email' => $data['email'],
68-
'password' => bcrypt($data['password']),
69+
'password' => Hash::make($data['password']),
6970
]);
7071
}
7172
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use Illuminate\Routing\Controller;
6+
use Illuminate\Foundation\Auth\VerifiesEmails;
7+
8+
class VerificationController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Email Verification Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling email verification for any
16+
| user that recently registered with the application. Emails may also
17+
| be resent if the user did not receive the original email message.
18+
|
19+
*/
20+
21+
use VerifiesEmails;
22+
23+
/**
24+
* Where to redirect users after verification.
25+
*
26+
* @var string
27+
*/
28+
protected $redirectTo = '/home';
29+
30+
/**
31+
* Create a new controller instance.
32+
*
33+
* @return void
34+
*/
35+
public function __construct()
36+
{
37+
$this->middleware('auth');
38+
$this->middleware('signed')->only('verify');
39+
$this->middleware('throttle:6,1')->only('verify', 'resend');
40+
}
41+
}

0 commit comments

Comments
 (0)