Skip to content

Commit

Permalink
Merge pull request #3 from Duhasky/ACL-1-Update
Browse files Browse the repository at this point in the history
ACL-1: updated
  • Loading branch information
jefpes authored May 22, 2024
2 parents 3d2e64c + 3296640 commit 908d1d2
Show file tree
Hide file tree
Showing 30 changed files with 227 additions and 118 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
APP_NAME=Base
APP_NAME="Project Base"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=America/Sao_Paulo
APP_URL=http://sincap.site
APP_URL=http://project_base.site

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
Expand All @@ -18,7 +18,7 @@ LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=base
DB_DATABASE=project_base
DB_USERNAME=root
DB_PASSWORD=root

Expand Down
6 changes: 4 additions & 2 deletions app/Livewire/Forms/UserForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ class UserForm extends Form

public ?string $password = null;

public ?string $password_confirmation = null;

/** @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> */
public function rules()
{
$rules = [
'name' => ['required', 'min:3', 'max:255'],
'user_name' => ['required', 'min:3', 'max:30'],
'user_name' => ['required', 'min:3', 'max:30', Rule::unique(User::class)->ignore($this->id)],
'email' => ['required', 'string', 'lowercase', 'email', 'max:255', Rule::unique(User::class)->ignore($this->id)],
'regist_number' => ['required', 'size:8', Rule::unique(User::class)->ignore($this->id)],
];

if (!$this->id) {
$rules['password'] = ['required', Password::min(4), 'max:12'];
$rules['password'] = ['required', Password::min(4), 'max:12', 'confirmed'];
}

return $rules;
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Profile/UpdatePasswordForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function updatePassword(): void
try {
$validated = $this->validate([
'current_password' => ['required', 'string', 'current_password'],
'password' => ['required', 'string', Password::defaults(), 'confirmed'],
'password' => ['required', Password::min(4), 'max:12', 'confirmed'],
]);
} catch (ValidationException $e) {
$this->reset('current_password', 'password', 'password_confirmation');
Expand Down
1 change: 1 addition & 0 deletions app/Livewire/User/UserRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ public function toggleRole(int $role_id): void
{
$this->user->roles()->toggle($role_id);
}

}
24 changes: 24 additions & 0 deletions app/Providers/TranslationServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class TranslationServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}

/**
* Bootstrap services.
*/
public function boot(): void
{
$this->loadJsonTranslationsFrom(resource_path('lang'));
}
}
1 change: 1 addition & 0 deletions bootstrap/providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
return [
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\TranslationServiceProvider::class,
App\Providers\VoltServiceProvider::class,
];
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.0",
"pestphp/pest-plugin-livewire": "^2.1",
"phpstan/phpstan": "^1.11",
"spatie/laravel-ignition": "^2.4"
},
"autoload": {
Expand Down
88 changes: 44 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
|
*/

'locale' => 'pt-br',
'locale' => 'pt_BR',

'fallback_locale' => 'pt-br',
'fallback_locale' => 'pt_BR',

'faker_locale' => 'pt_BR',

Expand Down
Loading

0 comments on commit 908d1d2

Please sign in to comment.