Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Kernel extends HttpKernel
*
* @var array
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
Expand Down
9 changes: 7 additions & 2 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
Expand All @@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
4 changes: 1 addition & 3 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class User extends Authenticatable
'config->notifications->email->observador',
];

# colocando data aqui ele já envia um objeto carbon
protected $dates = ['last_login_at'];

/**
* The attributes that should be hidden for arrays.
*
Expand All @@ -52,6 +49,7 @@ class User extends Authenticatable
*/
protected $casts = [
'email_verified_at' => 'datetime',
'last_login_at' => 'datetime',
'config' => 'array',
];

Expand Down
4 changes: 1 addition & 3 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->registerPolicies();

Gate::define('admin', function ($user) {
return $user->is_admin;
});
Expand Down Expand Up @@ -65,7 +63,7 @@ public function boot()
}
});


Gate::define('trocarPerfil', function ($user) {
return Gate::any(['admin', 'atendente']);
});
Expand Down
9 changes: 5 additions & 4 deletions app/Utils/JSONForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Utils;

use Form;
/* use Form; */
use Illuminate\Support\HtmlString;

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

# valores preenchidos
# aqui temos de usar "or" pois "||" não preenche corretamente
Expand All @@ -56,15 +56,16 @@ protected static function JSON2Form($template, $data, $perfil)
if (isset($json->validate) && strpos($json->validate, 'required') !== false) {
$attrib['required'] = '';
}
$input[] = Form::$type("extras[$key]", $json->value, $value, $attrib);
$input[] = html()->$type("extras[$key]", json_decode(json_encode($json->value), true))
->attributes($attrib);
break;

default:
$attrib = ['class' => 'form-control', 'rows' => '3'];
if (isset($json->validate) && strpos($json->validate, 'required') !== false) {
$attrib['required'] = '';
}
$input[] = Form::$type("extras[$key]", $value, $attrib);
$input[] = html()->$type("extras[$key]", $value, $attrib);
break;
}

Expand Down
24 changes: 11 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,29 @@
],
"license": "MIT",
"require": {
"php": "^7.3|^8.1",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"glorand/laravel-model-settings": "^4.2",
"graham-campbell/markdown": "^13.1",
"php": "^8.2",
"glorand/laravel-model-settings": "^8.0",
"graham-campbell/markdown": "^16.0",
"guzzlehttp/guzzle": "^7.0",
"laravel/framework": "^8.0",
"laravel/framework": "^12.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
"laravelcollective/html": "^6.2",
"laravel/ui": "^4.0",
"spatie/laravel-html": "^3.12",
"masakik/supervisor": "dev-master",
"spatie/simple-excel": "^1.13",
"spatie/simple-excel": "^3.8",
"uspdev/laravel-replicado": "^1.0",
"uspdev/laravel-tools": "^1.3",
"uspdev/laravel-usp-theme": "^2.8",
"uspdev/laravel-usp-validators": "^1.0",
"uspdev/senhaunica-socialite": "^4.3"
},
"require-dev": {
"facade/ignition": "^2.3.6",
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.10",
"lucascudo/laravel-pt-br-localization": "^1.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.0",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^11.0",
"uspdev/laravel-usp-faker": "^1.0"
},
"repositories": [
Expand Down Expand Up @@ -66,7 +64,7 @@
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
Expand Down
Loading