diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index e9f8ba0..f49d7a2 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -40,7 +40,7 @@ protected function schedule(Schedule $schedule) */ protected function commands() { - $this->load(__DIR__ . '/Commands'); + $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } diff --git a/app/Events/MessageSent.php b/app/Events/MessageSent.php index ae2168e..c0b1dab 100644 --- a/app/Events/MessageSent.php +++ b/app/Events/MessageSent.php @@ -34,7 +34,7 @@ class MessageSent implements ShouldBroadcast */ public function __construct(User $user, Message $message) { - $this->user = $user; + $this->user = $user; $this->message = $message; } diff --git a/app/Events/NotificationRead.php b/app/Events/NotificationRead.php index e43ff5b..7ae05c5 100644 --- a/app/Events/NotificationRead.php +++ b/app/Events/NotificationRead.php @@ -29,7 +29,7 @@ class NotificationRead implements ShouldBroadcast */ public function __construct($userId, $notificationId) { - $this->userId = $userId; + $this->userId = $userId; $this->notificationId = $notificationId; $this->dontBroadcastToCurrentUser(); diff --git a/app/Http/Controllers/Backend/PermissionsController.php b/app/Http/Controllers/Backend/PermissionsController.php index e78b7b8..71cff8b 100644 --- a/app/Http/Controllers/Backend/PermissionsController.php +++ b/app/Http/Controllers/Backend/PermissionsController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers\Backend; -use App\Http\Controllers\Controller; +use Route; use App\Models\Permission; use Illuminate\Http\Request; +use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Cache; -use Route; class PermissionsController extends Controller { @@ -40,8 +40,8 @@ public function create() */ public function store(Request $request) { - $Permissao = new Permission; - $Permissao->name = $request->input('name'); + $Permissao = new Permission; + $Permissao->name = $request->input('name'); $Permissao->label = $request->input('label'); $Permissao->save(); @@ -119,7 +119,7 @@ public function getGerar() if (starts_with($Rota->getName(), 'admin')) { $filterRouter = ['admin.empresas*', 'admin.permissio*', 'admin.super*', 'admin.profile*']; - if (!array_has($filterRouter, $Rota->getName())) { + if (! array_has($filterRouter, $Rota->getName())) { Permission::firstorCreate(['name' => $Rota->getName()]); } } diff --git a/app/Http/Controllers/Backend/RolesController.php b/app/Http/Controllers/Backend/RolesController.php index 2dc57a3..95aaaae 100644 --- a/app/Http/Controllers/Backend/RolesController.php +++ b/app/Http/Controllers/Backend/RolesController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers\Backend; -use App\Http\Controllers\Controller; -use App\Models\Permission; use App\Models\Role; +use App\Models\Permission; use Illuminate\Http\Request; +use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Cache; class RolesController extends Controller @@ -42,8 +42,8 @@ public function create() */ public function store(Request $request) { - $Role = new Role; - $Role->name = $request->input('name'); + $Role = new Role; + $Role->name = $request->input('name'); $Role->description = $request->input('description'); $Role->save(); @@ -62,7 +62,7 @@ public function store(Request $request) */ public function show($id) { - $Role = Role::with('permissions')->where('id', $id)->first(); + $Role = Role::with('permissions')->where('id', $id)->first(); $Permissions = Permission::all(); return view('backend.roles.edit', compact('Role', 'Permissions')); @@ -76,7 +76,7 @@ public function show($id) */ public function edit($id) { - $Role = Role::with('permissions')->where('id', $id)->first(); + $Role = Role::with('permissions')->where('id', $id)->first(); $Permissions = Permission::all(); return view('backend.roles.edit', compact('Role', 'Permissions')); diff --git a/app/Http/Controllers/Frontend/FrontendController.php b/app/Http/Controllers/Frontend/FrontendController.php index 9ebac45..ac3b3d6 100644 --- a/app/Http/Controllers/Frontend/FrontendController.php +++ b/app/Http/Controllers/Frontend/FrontendController.php @@ -28,12 +28,12 @@ public function getManifest() 'background_color' => '#0178BC', 'theme_color' => '#0178BC', 'icons' => [ - [ 'src' => 'launcher-icon-1x.png', 'type' => 'image/png', 'sizes' => '48x48' ], - [ 'src' => 'launcher-icon-2x.png', 'type' => 'image/png', 'sizes' => '96x96' ], - [ 'src' => 'launcher-icon-3x.png', 'type' => 'image/png', 'sizes' => '144x144' ], - [ 'src' => 'launcher-icon-4x.png', 'type' => 'image/png', 'sizes' => '192x192' ], - [ 'src' => 'launcher-icon-5x.png', 'type' => 'image/png', 'sizes' => '512x512' ] - ] + ['src' => 'launcher-icon-1x.png', 'type' => 'image/png', 'sizes' => '48x48'], + ['src' => 'launcher-icon-2x.png', 'type' => 'image/png', 'sizes' => '96x96'], + ['src' => 'launcher-icon-3x.png', 'type' => 'image/png', 'sizes' => '144x144'], + ['src' => 'launcher-icon-4x.png', 'type' => 'image/png', 'sizes' => '192x192'], + ['src' => 'launcher-icon-5x.png', 'type' => 'image/png', 'sizes' => '512x512'], + ], ]; } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index cbbe8b8..b5b82e7 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -68,7 +68,6 @@ public function handle($request, Closure $next, ...$guards) ($request->route()->getName() !== 'admin.profile.password')) { return redirect()->route('admin.profile.password')->with('info', 'Altere sua senha!'); } - /*! Coloca status de online ao usuario */ Cache::put('user-is-online-'.$this->auth->User()->id, true, Carbon::now()->addMinutes(2)); @@ -91,7 +90,7 @@ public function handle($request, Closure $next, ...$guards) } /*! Libera admin somente para quem tem regra */ - if($this->auth->User()->roles->count() === 0) { + if ($this->auth->User()->roles->count() === 0) { $this->auth->logout(); return redirect()->guest('/auth/login')->with('error', 'Acesso não permitido.'); diff --git a/app/Models/Activity.php b/app/Models/Activity.php index bca139f..2762cec 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -68,7 +68,7 @@ public function setDescricaoAttribute($value) } /** - * Returns a Formated activity + * Returns a Formated activity. * * @return string */ @@ -76,25 +76,25 @@ public function getActiviyAttribute() { switch ($this->acao) { case 'created': - echo "Criou novo "; + echo 'Criou novo '; break; case 'updated': - echo "Atualizou "; + echo 'Atualizou '; break; case 'deleted': - echo "Apagou "; + echo 'Apagou '; break; } switch ($this->content_type) { case 'App\User': - echo "Usuário"; + echo 'Usuário'; break; case 'App\Models\Profile': - echo "Perfil"; + echo 'Perfil'; break; } echo " (id: $this->content_id)"; - } + } } diff --git a/app/Notifications/DashboardNotification.php b/app/Notifications/DashboardNotification.php index c7d7e2d..6d38720 100644 --- a/app/Notifications/DashboardNotification.php +++ b/app/Notifications/DashboardNotification.php @@ -79,10 +79,10 @@ public function toWebPush($notifiable, $notification) public function toMail($notifiable) { return (new MailMessage) - ->subject('['.config('app.name').'] Nova notificação (' . Carbon::now() . ')') + ->subject('['.config('app.name').'] Nova notificação ('.Carbon::now().')') ->greeting($this->dados['title']) ->line($this->dados['body']) ->action('Visualizar', (isset($this->dados['action_url'])) ? $this->dados['action_url'] : null) ->line('Este E-mail Foi Gerado Automaticamente'); - } + } } diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 5ba52a6..692a202 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -3,9 +3,9 @@ namespace App\Providers; use App\Models\Permission; -use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Gate; +use Illuminate\Support\Facades\Cache; +use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { diff --git a/app/Providers/CarbonLanguageProvider.php b/app/Providers/CarbonLanguageProvider.php index 2814ecc..e4b07ed 100644 --- a/app/Providers/CarbonLanguageProvider.php +++ b/app/Providers/CarbonLanguageProvider.php @@ -11,6 +11,7 @@ public function boot() { // } + public function register() { Carbon::setLocale($this->app->getLocale()); diff --git a/public/index.php b/public/index.php index 4584cbc..2b5641b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,12 +1,10 @@ */ - define('LARAVEL_START', microtime(true)); /* diff --git a/resources/lang/pt_BR/validation.php b/resources/lang/pt_BR/validation.php index e0e12e4..2178c70 100644 --- a/resources/lang/pt_BR/validation.php +++ b/resources/lang/pt_BR/validation.php @@ -13,7 +13,6 @@ | */ - 'accepted' => ':attribute precisa ser aceito.', 'active_url' => ':attribute infelizmente não é uma URL válida.', 'after' => ':attribute precisa ser uma data depois de :date. Por favor, você pode verificar isso?', diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e9fe19c..06ece2c 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -3,7 +3,6 @@ namespace Tests\Unit; use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; class ExampleTest extends TestCase {