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 Jan 15, 2024
1 parent 27872c2 commit 6380e3e
Show file tree
Hide file tree
Showing 23 changed files with 360 additions and 360 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
2 changes: 1 addition & 1 deletion src/Commands/BadasoSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ protected function envListUpload()
'MIX_DEFAULT_MENU' => 'general',
'MIX_BADASO_MENU' => '${MIX_DEFAULT_MENU}',
'MIX_ADMIN_PANEL_ROUTE_PREFIX' => 'badaso-dashboard',
'MIX_BADASO_SECRET_LOGIN_PREFIX' =>'badaso-secret-login',
'MIX_BADASO_SECRET_LOGIN_PREFIX' => 'badaso-secret-login',
'MIX_API_ROUTE_PREFIX' => 'badaso-api',
'MIX_LOG_VIEWER_ROUTE' => '"log-viewer"',
'MIX_FIREBASE_API_KEY' => '',
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
68 changes: 34 additions & 34 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 @@ -62,10 +62,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 @@ -97,7 +97,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 @@ -120,10 +120,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 @@ -170,23 +170,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',
'address' => 'required|string|max:255',
'gender' => 'required|string',
]);

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

$role = $this->getCustomerRole();
Expand Down Expand Up @@ -222,10 +222,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 @@ -381,8 +381,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 @@ -541,12 +541,12 @@ public function updateProfile(Request $request)
$user_id = auth()->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 @@ -600,11 +600,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 @@ -617,7 +617,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 @@ -638,7 +638,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
Loading

0 comments on commit 6380e3e

Please sign in to comment.