Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit d12bced

Browse files
authored
Merge pull request #49 from JuanDMeGon/master
Upgrading to Laravel 6 hey @JuanDMeGon Thanks! this looks great! Fixes #47
2 parents 513b48c + 99e7946 commit d12bced

20 files changed

+983
-629
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
sudo: false
22
language: php
33
php:
4-
- 7.1
54
- 7.2
65
- 7.3
76
before_script:
@@ -14,4 +13,4 @@ script:
1413
- vendor/bin/phpunit --coverage-clover=coverage.clover
1514
after_script:
1615
- wget https://scrutinizer-ci.com/ocular.phar
17-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
16+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

app/Http/Controllers/Api/Assets/UploadFileController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers\Api\Assets;
44

55
use GuzzleHttp\Client;
6+
use Illuminate\Support\Str;
67
use Illuminate\Http\Request;
78
use App\Entities\Assets\Asset;
89
use Dingo\Api\Routing\Helpers;
@@ -146,7 +147,7 @@ protected function storeInDatabase(array $attributes, $path)
146147
*/
147148
protected function storeInFileSystem(array $attributes)
148149
{
149-
$path = md5(str_random(16).date('U')).'.'.$this->validMimes[$attributes['mime']]['extension'];
150+
$path = md5(Str::random(16).date('U')).'.'.$this->validMimes[$attributes['mime']]['extension'];
150151
Storage::put($path, $attributes['content']);
151152

152153
return $path;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Foundation\Auth\ConfirmsPasswords;
7+
8+
class ConfirmPasswordController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Confirm Password Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling password confirmations and
16+
| uses a simple trait to include the behavior. You're free to explore
17+
| this trait and override any functions that require customization.
18+
|
19+
*/
20+
21+
use ConfirmsPasswords;
22+
23+
/**
24+
* Where to redirect users when the intended url fails.
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+
}
39+
}

app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,4 @@ class ForgotPasswordController extends Controller
1919
*/
2020

2121
use SendsPasswordResetEmails;
22-
23-
/**
24-
* Create a new controller instance.
25-
*
26-
* @return void
27-
*/
28-
public function __construct()
29-
{
30-
$this->middleware('guest');
31-
}
3222
}

app/Http/Controllers/Auth/ResetPasswordController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,4 @@ class ResetPasswordController extends Controller
2626
* @var string
2727
*/
2828
protected $redirectTo = '/home';
29-
30-
/**
31-
* Create a new controller instance.
32-
*
33-
* @return void
34-
*/
35-
public function __construct()
36-
{
37-
$this->middleware('guest');
38-
}
3929
}

app/Http/Kernel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class Kernel extends HttpKernel
5252
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
5353
'can' => \Illuminate\Auth\Middleware\Authorize::class,
5454
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
55+
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
5556
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
5657
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
5758
'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
@@ -70,6 +71,7 @@ class Kernel extends HttpKernel
7071
\Illuminate\Session\Middleware\StartSession::class,
7172
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
7273
\App\Http\Middleware\Authenticate::class,
74+
\Illuminate\Routing\Middleware\ThrottleRequests::class,
7375
\Illuminate\Session\Middleware\AuthenticateSession::class,
7476
\Illuminate\Routing\Middleware\SubstituteBindings::class,
7577
\Illuminate\Auth\Middleware\Authorize::class,

composer.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.1.3",
17-
"dingo/api": "^2.3",
18-
"fideloper/proxy": "~4.0",
19-
"intervention/image": "^2.4",
20-
"intervention/imagecache": "^2.3",
21-
"laravel/framework": "5.8.*",
22-
"laravel/passport": "^7.0",
23-
"laravel/tinker": "~1.0",
24-
"spatie/laravel-permission": "^2.37"
16+
"php": "^7.2",
17+
"dingo/api": "^2.4",
18+
"fideloper/proxy": "^4.0",
19+
"intervention/image": "^2.5",
20+
"intervention/imagecache": "^2.4",
21+
"laravel/framework": "^6.2",
22+
"laravel/passport": "^7.5",
23+
"laravel/tinker": "^1.0",
24+
"spatie/laravel-permission": "^3.2"
2525
},
2626
"require-dev": {
27-
"beyondcode/laravel-dump-server": "^1.0",
28-
"filp/whoops": "^2.0",
27+
"facade/ignition": "^1.4",
2928
"fzaninotto/faker": "^1.4",
3029
"mockery/mockery": "^1.0",
3130
"nunomaduro/collision": "^3.0",
32-
"phpunit/phpunit": "^7.5"
31+
"phpunit/phpunit": "^8.0"
3332
},
3433
"config": {
3534
"optimize-autoloader": true,

0 commit comments

Comments
 (0)