Skip to content

Commit 96be3d8

Browse files
authored
Merge pull request #372 from uspdev/pr-371
Fix do pull request #371
2 parents c7bcdff + 16656a9 commit 96be3d8

33 files changed

Lines changed: 4168 additions & 3134 deletions

app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Kernel extends HttpKernel
5050
*
5151
* @var array
5252
*/
53-
protected $routeMiddleware = [
53+
protected $middlewareAliases = [
5454
'auth' => \App\Http\Middleware\Authenticate::class,
5555
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
5656
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,

app/Http/Middleware/TrustProxies.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Http\Middleware;
44

5-
use Fideloper\Proxy\TrustProxies as Middleware;
5+
use Illuminate\Http\Middleware\TrustProxies as Middleware;
66
use Illuminate\Http\Request;
77

88
class TrustProxies extends Middleware
@@ -19,5 +19,10 @@ class TrustProxies extends Middleware
1919
*
2020
* @var int
2121
*/
22-
protected $headers = Request::HEADER_X_FORWARDED_ALL;
22+
protected $headers =
23+
Request::HEADER_X_FORWARDED_FOR |
24+
Request::HEADER_X_FORWARDED_HOST |
25+
Request::HEADER_X_FORWARDED_PORT |
26+
Request::HEADER_X_FORWARDED_PROTO |
27+
Request::HEADER_X_FORWARDED_AWS_ELB;
2328
}

app/Models/User.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class User extends Authenticatable
3030
'config->notifications->email->observador',
3131
];
3232

33-
# colocando data aqui ele já envia um objeto carbon
34-
protected $dates = ['last_login_at'];
35-
3633
/**
3734
* The attributes that should be hidden for arrays.
3835
*
@@ -52,6 +49,7 @@ class User extends Authenticatable
5249
*/
5350
protected $casts = [
5451
'email_verified_at' => 'datetime',
52+
'last_login_at' => 'datetime',
5553
'config' => 'array',
5654
];
5755

app/Providers/AuthServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class AuthServiceProvider extends ServiceProvider
2424
*/
2525
public function boot()
2626
{
27-
$this->registerPolicies();
28-
2927
Gate::define('admin', function ($user) {
3028
return $user->is_admin;
3129
});
@@ -65,7 +63,7 @@ public function boot()
6563
}
6664
});
6765

68-
66+
6967
Gate::define('trocarPerfil', function ($user) {
7068
return Gate::any(['admin', 'atendente']);
7169
});

app/Utils/JSONForms.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Utils;
44

5-
use Form;
5+
/* use Form; */
66
use Illuminate\Support\HtmlString;
77

88
class JSONForms
@@ -43,7 +43,7 @@ protected static function JSON2Form($template, $data, $perfil)
4343
if (isset($json->validate) && strpos($json->validate, 'required') !== false) {
4444
$label = '<i class="fas fa-star-of-life fa-sm text-danger"></i> ' . $label;
4545
}
46-
$input[] = Form::label("extras[$key]", $label, ['class' => 'control-label']);
46+
$input[] = html()->label($label)->for("extras[$key]")->attribute('class','control-label');
4747

4848
# valores preenchidos
4949
# aqui temos de usar "or" pois "||" não preenche corretamente
@@ -52,19 +52,24 @@ protected static function JSON2Form($template, $data, $perfil)
5252
switch ($type) {
5353
//caso seja um select passa o valor padrao
5454
case 'select':
55-
$attrib = ['class' => 'form-control', 'placeholder' => 'Selecione...'];
55+
$fieldInput = html()->$type("extras[$key]", json_decode(json_encode($json->value), true))
56+
->class('form-control')->placeholder('Selecione...');;
57+
5658
if (isset($json->validate) && strpos($json->validate, 'required') !== false) {
57-
$attrib['required'] = '';
59+
$fieldInput = $fieldInput ->required();
5860
}
59-
$input[] = Form::$type("extras[$key]", $json->value, $value, $attrib);
61+
62+
$input[] = $fieldInput;
6063
break;
6164

6265
default:
63-
$attrib = ['class' => 'form-control', 'rows' => '3'];
66+
$fieldInput = html()->textarea("extras[$key]", $value)->class('form-control')->rows(3);
67+
6468
if (isset($json->validate) && strpos($json->validate, 'required') !== false) {
65-
$attrib['required'] = '';
69+
$fieldInput = $fieldInput ->required();
6670
}
67-
$input[] = Form::$type("extras[$key]", $value, $attrib);
71+
72+
$input[] = $fieldInput;
6873
break;
6974
}
7075

composer.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,29 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": "^7.3|^8.1",
12-
"fideloper/proxy": "^4.2",
13-
"fruitcake/laravel-cors": "^2.0",
14-
"glorand/laravel-model-settings": "^4.2",
15-
"graham-campbell/markdown": "^13.1",
11+
"php": "^8.2",
12+
"glorand/laravel-model-settings": "^8.0",
13+
"graham-campbell/markdown": "^16.0",
1614
"guzzlehttp/guzzle": "^7.0",
17-
"laravel/framework": "^8.0",
15+
"laravel/framework": "^12.0",
1816
"laravel/tinker": "^2.0",
19-
"laravel/ui": "^3.0",
20-
"laravelcollective/html": "^6.2",
17+
"laravel/ui": "^4.0",
18+
"spatie/laravel-html": "^3.12",
2119
"masakik/supervisor": "dev-master",
22-
"spatie/simple-excel": "^1.13",
20+
"spatie/simple-excel": "^3.8",
2321
"uspdev/laravel-replicado": "^1.0",
2422
"uspdev/laravel-tools": "^1.3",
2523
"uspdev/laravel-usp-theme": "^2.8",
2624
"uspdev/laravel-usp-validators": "^1.0",
2725
"uspdev/senhaunica-socialite": "^4.3"
2826
},
2927
"require-dev": {
30-
"facade/ignition": "^2.3.6",
28+
"spatie/laravel-ignition": "^2.0",
3129
"fakerphp/faker": "^1.10",
3230
"lucascudo/laravel-pt-br-localization": "^1.1",
3331
"mockery/mockery": "^1.3.1",
34-
"nunomaduro/collision": "^5.0",
35-
"phpunit/phpunit": "^9.0",
32+
"nunomaduro/collision": "^8.1",
33+
"phpunit/phpunit": "^11.0",
3634
"uspdev/laravel-usp-faker": "^1.0"
3735
},
3836
"repositories": [
@@ -66,7 +64,7 @@
6664
"Tests\\": "tests/"
6765
}
6866
},
69-
"minimum-stability": "dev",
67+
"minimum-stability": "stable",
7068
"prefer-stable": true,
7169
"scripts": {
7270
"post-autoload-dump": [

0 commit comments

Comments
 (0)