Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Apr 1, 2024
1 parent 4c4cb2d commit 108479e
Show file tree
Hide file tree
Showing 22 changed files with 358 additions and 358 deletions.
18 changes: 9 additions & 9 deletions src/Badaso.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
class Badaso
{
protected $models = [
'DataRow' => DataRow::class,
'DataType' => DataType::class,
'Permission' => Permission::class,
'Role' => Role::class,
'User' => User::class,
'UserRole' => UserRole::class,
'DataRow' => DataRow::class,
'DataType' => DataType::class,
'Permission' => Permission::class,
'Role' => Role::class,
'User' => User::class,
'UserRole' => UserRole::class,
'RolePermission' => RolePermission::class,
'Menu' => Menu::class,
'MenuItem' => MenuItem::class,
'Configuration' => Configuration::class,
'Menu' => Menu::class,
'MenuItem' => MenuItem::class,
'Configuration' => Configuration::class,
];

protected $supported_component = [
Expand Down
16 changes: 8 additions & 8 deletions src/Config/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@
*/
'notifications' => [
'notifications' => [
\Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => ['mail'],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => ['mail'],
],

/*
Expand Down Expand Up @@ -137,9 +137,9 @@
*/
'monitorBackups' => [
[
'name' => config('app.name'),
'disks' => explode(',', env('BACKUP_DISK', '')),
'newestBackupsShouldNotBeOlderThanDays' => 1,
'name' => config('app.name'),
'disks' => explode(',', env('BACKUP_DISK', '')),
'newestBackupsShouldNotBeOlderThanDays' => 1,
'storageUsedMayNotBeHigherThanMegabytes' => 5000,
],

Expand Down
38 changes: 19 additions & 19 deletions src/Config/log-viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/

'pattern' => [
'prefix' => Filesystem::PATTERN_PREFIX, // 'laravel-'
'date' => Filesystem::PATTERN_DATE, // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
'prefix' => Filesystem::PATTERN_PREFIX, // 'laravel-'
'date' => Filesystem::PATTERN_DATE, // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
'extension' => Filesystem::PATTERN_EXTENSION, // '.log'
],

Expand Down Expand Up @@ -103,15 +103,15 @@
* Font awesome >= 4.3
* http://fontawesome.io/icons/
*/
'all' => 'fa fa-fw fa-list', // http://fontawesome.io/icon/list/
'all' => 'fa fa-fw fa-list', // http://fontawesome.io/icon/list/
'emergency' => 'fa fa-fw fa-bug', // http://fontawesome.io/icon/bug/
'alert' => 'fa fa-fw fa-bullhorn', // http://fontawesome.io/icon/bullhorn/
'critical' => 'fa fa-fw fa-heartbeat', // http://fontawesome.io/icon/heartbeat/
'error' => 'fa fa-fw fa-times-circle', // http://fontawesome.io/icon/times-circle/
'warning' => 'fa fa-fw fa-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/
'notice' => 'fa fa-fw fa-exclamation-circle', // http://fontawesome.io/icon/exclamation-circle/
'info' => 'fa fa-fw fa-info-circle', // http://fontawesome.io/icon/info-circle/
'debug' => 'fa fa-fw fa-life-ring', // http://fontawesome.io/icon/life-ring/
'alert' => 'fa fa-fw fa-bullhorn', // http://fontawesome.io/icon/bullhorn/
'critical' => 'fa fa-fw fa-heartbeat', // http://fontawesome.io/icon/heartbeat/
'error' => 'fa fa-fw fa-times-circle', // http://fontawesome.io/icon/times-circle/
'warning' => 'fa fa-fw fa-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/
'notice' => 'fa fa-fw fa-exclamation-circle', // http://fontawesome.io/icon/exclamation-circle/
'info' => 'fa fa-fw fa-info-circle', // http://fontawesome.io/icon/info-circle/
'debug' => 'fa fa-fw fa-life-ring', // http://fontawesome.io/icon/life-ring/
],

/* -----------------------------------------------------------------
Expand All @@ -121,16 +121,16 @@

'colors' => [
'levels' => [
'empty' => '#D1D1D1',
'all' => '#8A8A8A',
'empty' => '#D1D1D1',
'all' => '#8A8A8A',
'emergency' => '#B71C1C',
'alert' => '#D32F2F',
'critical' => '#F44336',
'error' => '#FF5722',
'warning' => '#FF9100',
'notice' => '#4CAF50',
'info' => '#1976D2',
'debug' => '#90CAF9',
'alert' => '#D32F2F',
'critical' => '#F44336',
'error' => '#FF5722',
'warning' => '#FF9100',
'notice' => '#4CAF50',
'info' => '#1976D2',
'debug' => '#90CAF9',
],
],

Expand Down
64 changes: 32 additions & 32 deletions src/Controllers/BadasoAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function secretLogin(Request $request)
try {
$remember = $request->get('remember', false);
$credentials = [
'email' => $request->email,
'email' => $request->email,
'password' => $request->password,
];
$request->validate([
Expand All @@ -63,10 +63,10 @@ function ($attribute, $value, $fail) use ($credentials) {
$token_lifetime = env('VERIFICATION_TOKEN_LIFETIME', 5);
$expired_token = date('Y-m-d H:i:s', strtotime("+$token_lifetime minutes", strtotime(date('Y-m-d H:i:s'))));
$data = [
'user_id' => $user->id,
'user_id' => $user->id,
'verification_token' => $token,
'expired_at' => $expired_token,
'count_incorrect' => 0,
'expired_at' => $expired_token,
'count_incorrect' => 0,
];

UserVerification::firstOrCreate($data);
Expand All @@ -92,7 +92,7 @@ public function login(Request $request)
try {
$remember = $request->get('remember', false);
$credentials = [
'email' => $request->email,
'email' => $request->email,
'password' => $request->password,
];
$request->validate([
Expand All @@ -116,10 +116,10 @@ function ($attribute, $value, $fail) use ($credentials) {
$token_lifetime = env('VERIFICATION_TOKEN_LIFETIME', 5);
$expired_token = date('Y-m-d H:i:s', strtotime("+$token_lifetime minutes", strtotime(date('Y-m-d H:i:s'))));
$data = [
'user_id' => $user->id,
'user_id' => $user->id,
'verification_token' => $token,
'expired_at' => $expired_token,
'count_incorrect' => 0,
'expired_at' => $expired_token,
'count_incorrect' => 0,
];

UserVerification::firstOrCreate($data);
Expand Down Expand Up @@ -160,23 +160,23 @@ public function register(Request $request)
try {
DB::beginTransaction();
$request->validate([
'name' => 'required|string|max:255',
'name' => 'required|string|max:255',
'username' => 'required|string|max:255|alpha_num',
'phone' => 'required|numeric|min:6',
'email' => 'required|string|email|max:255|unique:Uasoft\Badaso\Models\User',
'phone' => 'required|numeric|min:6',
'email' => 'required|string|email|max:255|unique:Uasoft\Badaso\Models\User',
'password' => 'required|string|min:6|confirmed',
'address' => 'required|string|max:255',
'gender' => 'required|string',
'gender' => 'required|string',
]);

$user = User::create([
'name' => $request->get('name'),
'name' => $request->get('name'),
'username' => $request->get('username'),
'phone' => $request->get('phone'),
'address' => $request->get('address'),
'email' => $request->get('email'),
'email' => $request->get('email'),
'password' => Hash::make($request->get('password')),
'gender' => $request->get('gender'),
'gender' => $request->get('gender'),
]);

$role = $this->getCustomerRole();
Expand Down Expand Up @@ -211,10 +211,10 @@ public function register(Request $request)
$token_lifetime = env('VERIFICATION_TOKEN_LIFETIME', 5);
$expired_token = date('Y-m-d H:i:s', strtotime("+$token_lifetime minutes", strtotime(date('Y-m-d H:i:s'))));
$data = [
'user_id' => $user->id,
'user_id' => $user->id,
'verification_token' => $token,
'expired_at' => $expired_token,
'count_incorrect' => 0,
'expired_at' => $expired_token,
'count_incorrect' => 0,
];

UserVerification::firstOrCreate($data);
Expand Down Expand Up @@ -361,8 +361,8 @@ public function forgetPassword(Request $request)
$token = rand(111111, 999999);

PasswordReset::insert([
'email' => $request->email,
'token' => $token,
'email' => $request->email,
'token' => $token,
'created_at' => date('Y-m-d H:i:s'),
]);

Expand Down Expand Up @@ -523,12 +523,12 @@ public function updateProfile(Request $request)
$user_id = Auth::guard($guard)->user()->id;

$request->validate([
'name' => 'required|string|max:255',
'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$user_id}",
'avatar' => 'nullable',
'phone' => 'nullable',
'address' => 'nullable',
'gender' => 'nullable',
'name' => 'required|string|max:255',
'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$user_id}",
'avatar' => 'nullable',
'phone' => 'nullable',
'address' => 'nullable',
'gender' => 'nullable',
]);

$user = User::find($user->id);
Expand Down Expand Up @@ -582,11 +582,11 @@ public function updateEmail(Request $request)
$token_lifetime = env('VERIFICATION_TOKEN_LIFETIME', 5);
$expired_token = date('Y-m-d H:i:s', strtotime("+$token_lifetime minutes", strtotime(date('Y-m-d H:i:s'))));
$data = [
'user_id' => $user->id,
'email' => $request->email,
'user_id' => $user->id,
'email' => $request->email,
'verification_token' => $token,
'expired_at' => $expired_token,
'count_incorrect' => 0,
'expired_at' => $expired_token,
'count_incorrect' => 0,
];

EmailReset::firstOrCreate($data);
Expand All @@ -608,7 +608,7 @@ public function updateEmail(Request $request)

return ApiResponse::success([
'should_verify_email' => true,
'message' => __('badaso::validation.verification.email_sended'),
'message' => __('badaso::validation.verification.email_sended'),
]);
} else {
$user->email = $request->email;
Expand All @@ -619,7 +619,7 @@ public function updateEmail(Request $request)

return ApiResponse::success([
'should_verify_email' => false,
'user' => $user,
'user' => $user,
]);
} catch (Exception $e) {
DB::rollBack();
Expand Down
14 changes: 7 additions & 7 deletions src/Controllers/BadasoFirebaseConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public function UpdateConfig(Request $request)
{
try {
$request->validate([
'apiKey' => ['required'],
'authDomain' => ['required'],
'projectId' => ['required'],
'storageBucket' => ['required'],
'apiKey' => ['required'],
'authDomain' => ['required'],
'projectId' => ['required'],
'storageBucket' => ['required'],
'messagingSenderId' => ['required'],
'appId' => ['required'],
'measureId' => ['required'],
'serverKey' => ['required'],
'appId' => ['required'],
'measureId' => ['required'],
'serverKey' => ['required'],
]);

$firebaseService = FirebaseServices::first()->updateOrCreate([]);
Expand Down
32 changes: 16 additions & 16 deletions src/Controllers/BadasoMenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function readMenuItem(Request $request)
{
try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_item_id' => ['required', 'exists:Uasoft\Badaso\Models\MenuItem,id'],
]);

Expand Down Expand Up @@ -281,7 +281,7 @@ public function addMenu(Request $request)

try {
$request->validate([
'key' => ['required', 'unique:Uasoft\Badaso\Models\Menu'],
'key' => ['required', 'unique:Uasoft\Badaso\Models\Menu'],
'display_name' => ['required'],
]);

Expand Down Expand Up @@ -314,9 +314,9 @@ public function addMenuItem(Request $request)
try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'title' => ['required'],
'url' => ['required'],
'target' => ['required'],
'title' => ['required'],
'url' => ['required'],
'target' => ['required'],
]);

$url = $request->get('url');
Expand Down Expand Up @@ -357,8 +357,8 @@ public function editMenu(Request $request)

try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'key' => ['required', "unique:Uasoft\Badaso\Models\Menu,key,{$request->menu_id}"],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'key' => ['required', "unique:Uasoft\Badaso\Models\Menu,key,{$request->menu_id}"],
'display_name' => ['required'],
]);

Expand Down Expand Up @@ -396,11 +396,11 @@ public function editMenuItem(Request $request)

try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_item_id' => ['required', 'exists:Uasoft\Badaso\Models\MenuItem,id'],
'title' => ['required'],
'url' => ['required'],
'target' => ['required'],
'title' => ['required'],
'url' => ['required'],
'target' => ['required'],
]);

$url = $request->get('url');
Expand Down Expand Up @@ -433,7 +433,7 @@ public function editMenuItemOrder(Request $request)

try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_item_id' => ['required', 'exists:Uasoft\Badaso\Models\MenuItem,id'],
]);
$menu_item = MenuItem::find($request->menu_item_id);
Expand Down Expand Up @@ -499,7 +499,7 @@ public function editMenuItemsOrder(Request $request)

try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_items' => ['required'],
]);

Expand Down Expand Up @@ -565,7 +565,7 @@ public function deleteMenuItem(Request $request)

try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_item_id' => ['required', 'exists:Uasoft\Badaso\Models\MenuItem,id'],
]);

Expand All @@ -592,7 +592,7 @@ public function getMenuItemPermissions(Request $request)
{
try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_item_id' => ['required', 'exists:Uasoft\Badaso\Models\MenuItem,id'],
]);

Expand Down Expand Up @@ -628,7 +628,7 @@ public function setMenuItemPermissions(Request $request)

try {
$request->validate([
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_id' => ['required', 'exists:Uasoft\Badaso\Models\Menu,id'],
'menu_item_id' => ['required', 'exists:Uasoft\Badaso\Models\MenuItem,id'],
]);

Expand Down
Loading

0 comments on commit 108479e

Please sign in to comment.