diff --git a/src/Badaso.php b/src/Badaso.php index 96ee4d73c..dd6742124 100644 --- a/src/Badaso.php +++ b/src/Badaso.php @@ -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 = [ diff --git a/src/Commands/BadasoSetup.php b/src/Commands/BadasoSetup.php index bcd1d2580..411c9ba2c 100644 --- a/src/Commands/BadasoSetup.php +++ b/src/Commands/BadasoSetup.php @@ -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' => '', diff --git a/src/Config/backup.php b/src/Config/backup.php index f0f139e9e..5ccc08153 100644 --- a/src/Config/backup.php +++ b/src/Config/backup.php @@ -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'], ], /* @@ -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, ], diff --git a/src/Config/log-viewer.php b/src/Config/log-viewer.php index bf9be9f45..fe91dddb9 100644 --- a/src/Config/log-viewer.php +++ b/src/Config/log-viewer.php @@ -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' ], @@ -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/ ], /* ----------------------------------------------------------------- @@ -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', ], ], diff --git a/src/Controllers/BadasoAuthController.php b/src/Controllers/BadasoAuthController.php index cf0c22121..414a82459 100644 --- a/src/Controllers/BadasoAuthController.php +++ b/src/Controllers/BadasoAuthController.php @@ -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([ @@ -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); @@ -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([ @@ -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); @@ -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(); @@ -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); @@ -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'), ]); @@ -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); @@ -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); @@ -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; @@ -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(); diff --git a/src/Controllers/BadasoFirebaseConfigController.php b/src/Controllers/BadasoFirebaseConfigController.php index 97ec8b66d..a4117588b 100644 --- a/src/Controllers/BadasoFirebaseConfigController.php +++ b/src/Controllers/BadasoFirebaseConfigController.php @@ -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([]); diff --git a/src/Controllers/BadasoMenuController.php b/src/Controllers/BadasoMenuController.php index b9fbd1953..0ab8f4dd5 100644 --- a/src/Controllers/BadasoMenuController.php +++ b/src/Controllers/BadasoMenuController.php @@ -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'], ]); @@ -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'], ]); @@ -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'); @@ -358,8 +358,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'], ]); @@ -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'); @@ -446,7 +446,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); @@ -511,7 +511,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'], ]); @@ -575,7 +575,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'], ]); @@ -602,7 +602,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'], ]); @@ -638,7 +638,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'], ]); diff --git a/src/Controllers/BadasoPermissionController.php b/src/Controllers/BadasoPermissionController.php index cc0288a39..63eceb19b 100644 --- a/src/Controllers/BadasoPermissionController.php +++ b/src/Controllers/BadasoPermissionController.php @@ -50,13 +50,13 @@ public function edit(Request $request) 'required', 'exists:Uasoft\Badaso\Models\Permission,id', ], - 'key' => "required|unique:Uasoft\Badaso\Models\Permission,key,{$request->id}", - 'description' => 'nullable', + 'key' => "required|unique:Uasoft\Badaso\Models\Permission,key,{$request->id}", + 'description' => 'nullable', 'always_allow' => 'required', - 'is_public' => 'required', - 'table_name' => 'nullable', - 'roles_can_see_all_data' => 'nullable', - 'field_identify_related_user' => 'nullable', + 'is_public' => 'required', + 'table_name' => 'nullable', + 'roles_can_see_all_data' => 'nullable', + 'field_identify_related_user' => 'nullable', ]); $permission = Permission::find($request->id); @@ -96,10 +96,10 @@ public function add(Request $request) try { $request->validate([ - 'key' => 'required|unique:Uasoft\Badaso\Models\Permission', - 'description' => 'nullable', + 'key' => 'required|unique:Uasoft\Badaso\Models\Permission', + 'description' => 'nullable', 'always_allow' => 'required', - 'is_public' => 'required', + 'is_public' => 'required', ]); $permission = new Permission(); diff --git a/src/Controllers/BadasoRoleController.php b/src/Controllers/BadasoRoleController.php index 11723fe07..daf0ad31a 100644 --- a/src/Controllers/BadasoRoleController.php +++ b/src/Controllers/BadasoRoleController.php @@ -50,9 +50,9 @@ public function edit(Request $request) 'required', 'exists:Uasoft\Badaso\Models\Role,id', ], - 'name' => "required|unique:Uasoft\Badaso\Models\Role,name,{$request->id}", + 'name' => "required|unique:Uasoft\Badaso\Models\Role,name,{$request->id}", 'display_name' => 'required', - 'description' => 'nullable', + 'description' => 'nullable', ]); $role = Role::find($request->id); @@ -89,9 +89,9 @@ public function add(Request $request) try { $request->validate([ - 'name' => 'required|unique:Uasoft\Badaso\Models\Role,name', + 'name' => 'required|unique:Uasoft\Badaso\Models\Role,name', 'display_name' => 'required', - 'description' => 'nullable', + 'description' => 'nullable', ]); $role = new Role(); diff --git a/src/Controllers/BadasoRolePermissionController.php b/src/Controllers/BadasoRolePermissionController.php index f0d7fe716..7fc6f1ffe 100644 --- a/src/Controllers/BadasoRolePermissionController.php +++ b/src/Controllers/BadasoRolePermissionController.php @@ -81,7 +81,7 @@ public function addOrEdit(Request $request) try { $request->validate([ 'permissions' => ['required'], - 'role_id' => ['required', 'exists:Uasoft\Badaso\Models\Role,id'], + 'role_id' => ['required', 'exists:Uasoft\Badaso\Models\Role,id'], ]); $permissions = $request->permissions; @@ -92,7 +92,7 @@ public function addOrEdit(Request $request) $permission = Permission::find($value); if (! is_null($permission)) { $role_permission = [ - 'role_id' => $role->id, + 'role_id' => $role->id, 'permission_id' => $permission->id, ]; diff --git a/src/Controllers/BadasoUserController.php b/src/Controllers/BadasoUserController.php index 1448fe321..8e8d09b38 100644 --- a/src/Controllers/BadasoUserController.php +++ b/src/Controllers/BadasoUserController.php @@ -52,14 +52,14 @@ public function edit(Request $request) try { $request->validate([ - 'id' => 'required|exists:Uasoft\Badaso\Models\User,id', - 'email' => "required|email|unique:Uasoft\Badaso\Models\User,email,{$request->id}", - 'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$request->id}", - 'name' => 'required', - 'avatar' => 'nullable', - 'phone' => 'nullable', - 'address' => 'nullable', - 'gender' => 'nullable', + 'id' => 'required|exists:Uasoft\Badaso\Models\User,id', + 'email' => "required|email|unique:Uasoft\Badaso\Models\User,email,{$request->id}", + 'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$request->id}", + 'name' => 'required', + 'avatar' => 'nullable', + 'phone' => 'nullable', + 'address' => 'nullable', + 'gender' => 'nullable', ]); $user = User::find($request->id); @@ -106,13 +106,13 @@ public function add(Request $request) try { $request->validate([ - 'email' => 'required|email|unique:Uasoft\Badaso\Models\User', - 'name' => 'required|string|max:255', - 'username' => 'required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username', - 'avatar' => 'nullable', - 'phone' => 'required|numeric|min:6', - 'address' => 'nullable', - 'gender' => 'required|string', + 'email' => 'required|email|unique:Uasoft\Badaso\Models\User', + 'name' => 'required|string|max:255', + 'username' => 'required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username', + 'avatar' => 'nullable', + 'phone' => 'required|numeric|min:6', + 'address' => 'nullable', + 'gender' => 'required|string', ]); $user = new User(); diff --git a/src/Controllers/Controller.php b/src/Controllers/Controller.php index 296772bba..b0362eb41 100644 --- a/src/Controllers/Controller.php +++ b/src/Controllers/Controller.php @@ -48,7 +48,7 @@ public function isAuthorize($method, $data_type) WHERE u.id = :user_id AND p.key = :permission ', [ - 'user_id' => $user->id, + 'user_id' => $user->id, 'permission' => $method.'_'.$data_type->name, ]); @@ -215,13 +215,13 @@ public function getDataList($slug, $request, $only_data_soft_delete = false) $data = []; $records = []; $builder_params = [ - 'limit' => isset($request['limit']) ? $request['limit'] : 10, - 'page' => isset($request['page']) ? $request['page'] : null, - 'order_field' => isset($request['order_field']) ? $request['order_field'] : $data_type->order_column, + 'limit' => isset($request['limit']) ? $request['limit'] : 10, + 'page' => isset($request['page']) ? $request['page'] : null, + 'order_field' => isset($request['order_field']) ? $request['order_field'] : $data_type->order_column, 'order_direction' => isset($request['order_direction']) ? $request['order_direction'] : $data_type->order_direction, - 'filter_key' => isset($request['filter_key']) ? $request['filter_key'] : null, + 'filter_key' => isset($request['filter_key']) ? $request['filter_key'] : null, 'filter_operator' => isset($request['filter_operator']) ? $request['filter_operator'] : 'containts', - 'filter_value' => isset($request['filter_value']) ? $request['filter_value'] : '', + 'filter_value' => isset($request['filter_value']) ? $request['filter_value'] : '', ]; if ($data_type->model_name) { @@ -331,13 +331,13 @@ public function insertData($data, $data_type) }); $multi_select[] = [ - 'model' => $model_manytomany['model_name'], - 'content' => $data_manytomany, - 'table' => $table_manytomany, + 'model' => $model_manytomany['model_name'], + 'content' => $data_manytomany, + 'table' => $table_manytomany, 'foreignPivotKey' => $table_primary.'_id' ? $table_primary.'_id' : null, 'relatedPivotKey' => $table_relation.'_id' ? $table_relation.'_id' : null, - 'parentKey' => null, - 'relatedKey' => 'id', + 'parentKey' => null, + 'relatedKey' => 'id', ]; } } @@ -463,13 +463,13 @@ public function updateData($data, $data_type) }); $multi_select[] = [ - 'model' => $model_manytomany['model_name'], - 'content' => $data_manytomany, - 'table' => $table_manytomany, + 'model' => $model_manytomany['model_name'], + 'content' => $data_manytomany, + 'table' => $table_manytomany, 'foreignPivotKey' => $table_primary.'_id' ? $table_primary.'_id' : null, 'relatedPivotKey' => $table_relation.'_id' ? $table_relation.'_id' : null, - 'parentKey' => null, - 'relatedKey' => 'id', + 'parentKey' => null, + 'relatedKey' => 'id', ]; } if (isset($data_row['relation']) && $data_row['relation']['relation_type'] == 'has_one') { @@ -591,7 +591,7 @@ public function updateData($data, $data_type) } return [ - 'old_data' => $old_data, + 'old_data' => $old_data, 'updated_data' => $model, ]; } diff --git a/src/Database/Schema/ForeignKey.php b/src/Database/Schema/ForeignKey.php index f84f5328f..d8be19f68 100644 --- a/src/Database/Schema/ForeignKey.php +++ b/src/Database/Schema/ForeignKey.php @@ -49,12 +49,12 @@ public static function make(array $foreign_key) public static function toArray(DoctrineForeignKey $fk) { return [ - 'name' => $fk->getName(), - 'local_table' => $fk->getLocalTableName(), - 'local_columns' => $fk->getLocalColumns(), - 'foreign_table' => $fk->getForeignTableName(), + 'name' => $fk->getName(), + 'local_table' => $fk->getLocalTableName(), + 'local_columns' => $fk->getLocalColumns(), + 'foreign_table' => $fk->getForeignTableName(), 'foreign_columns' => $fk->getForeignColumns(), - 'options' => $fk->getOptions(), + 'options' => $fk->getOptions(), ]; } } diff --git a/src/Database/Schema/Index.php b/src/Database/Schema/Index.php index 79b3ca416..67950b3e5 100644 --- a/src/Database/Schema/Index.php +++ b/src/Database/Schema/Index.php @@ -60,15 +60,15 @@ public static function toArray(DoctrineIndex $index) $columns = $index->getColumns(); return [ - 'name' => $name, - 'oldName' => $name, - 'columns' => $columns, - 'type' => static::getType($index), - 'is_primary' => $index->isPrimary(), - 'is_unique' => $index->isUnique(), - 'isComposite' => count($columns) > 1, - 'flags' => $index->getFlags(), - 'options' => $index->getOptions(), + 'name' => $name, + 'oldName' => $name, + 'columns' => $columns, + 'type' => static::getType($index), + 'is_primary' => $index->isPrimary(), + 'is_unique' => $index->isUnique(), + 'isComposite' => count($columns) > 1, + 'flags' => $index->getFlags(), + 'options' => $index->getOptions(), ]; } diff --git a/src/Database/Schema/Table.php b/src/Database/Schema/Table.php index b7d529b85..4f62de00c 100644 --- a/src/Database/Schema/Table.php +++ b/src/Database/Schema/Table.php @@ -98,13 +98,13 @@ public function diffOriginal() public function toArray() { return [ - 'name' => $this->_name, - 'oldName' => $this->_name, - 'columns' => $this->exportColumnsToArray(), - 'indexes' => $this->exportIndexesToArray(), - 'primaryKeyName' => $this->_primaryKeyName, - 'foreign_keys' => $this->exportForeignKeysToArray(), - 'options' => $this->_options, + 'name' => $this->_name, + 'oldName' => $this->_name, + 'columns' => $this->exportColumnsToArray(), + 'indexes' => $this->exportIndexesToArray(), + 'primaryKeyName' => $this->_primaryKeyName, + 'foreign_keys' => $this->exportForeignKeysToArray(), + 'options' => $this->_options, ]; } diff --git a/src/Database/Types/Type.php b/src/Database/Types/Type.php index 8ee700ecb..f6c64c6e4 100644 --- a/src/Database/Types/Type.php +++ b/src/Database/Types/Type.php @@ -159,7 +159,7 @@ public static function registerCustomOption($name, $value, $types) } static::$custom_type_options[] = [ - 'name' => $name, + 'name' => $name, 'value' => $value, 'types' => $types, ]; @@ -191,7 +191,7 @@ protected static function registerTypeDefaultOptions() ], 'time'); static::registerCustomOption('default', [ 'type' => 'number', - 'min' => '0', + 'min' => '0', ], 'year'); } @@ -318,14 +318,14 @@ public static function getTypeCategories() ]; static::$type_categories = [ - 'numbers' => $numbers, - 'strings' => $strings, + 'numbers' => $numbers, + 'strings' => $strings, 'datetime' => $datetime, - 'lists' => $lists, - 'binary' => $binary, - 'network' => $network, + 'lists' => $lists, + 'binary' => $binary, + 'network' => $network, 'geometry' => $geometry, - 'objects' => $objects, + 'objects' => $objects, ]; return static::$type_categories; diff --git a/src/Helpers/CallHelperTest.php b/src/Helpers/CallHelperTest.php index 83d073dad..4fa8d018d 100644 --- a/src/Helpers/CallHelperTest.php +++ b/src/Helpers/CallHelperTest.php @@ -79,7 +79,7 @@ public static function handleUserAdminAuthorize(TestCase $test_case) { $user = self::getUserAdminRole(); $response = $test_case->json('POST', CallHelperTest::getUrlApiV1Prefix('/auth/login'), [ - 'email' => $user->email, + 'email' => $user->email, 'password' => $user->name, 'remember' => false, ]); diff --git a/src/Helpers/DataTypeToComponent.php b/src/Helpers/DataTypeToComponent.php index 91336a373..f59161e42 100644 --- a/src/Helpers/DataTypeToComponent.php +++ b/src/Helpers/DataTypeToComponent.php @@ -6,43 +6,43 @@ class DataTypeToComponent { //MYSQL protected static $type_list = [ - 'CHAR' => 'text', - 'VARCHAR' => 'text', - 'BINARY' => 'text', - 'VARBINARY' => 'text', - 'TINYBLOB' => 'text', - 'TINYTEXT' => 'text', - 'TEXT' => 'textarea', - 'BLOB' => 'text', + 'CHAR' => 'text', + 'VARCHAR' => 'text', + 'BINARY' => 'text', + 'VARBINARY' => 'text', + 'TINYBLOB' => 'text', + 'TINYTEXT' => 'text', + 'TEXT' => 'textarea', + 'BLOB' => 'text', 'MEDIUMTEXT' => 'text', 'MEDIUMBLOB' => 'text', - 'LONGTEXT' => 'text', - 'LONGBLOB' => 'text', - 'CHARACTER VARYING' => 'text', - 'CHARACTER' => 'text', - 'BYTEA' => 'text', - 'JSON' => 'text', - 'ENUM' => 'select', - 'SET' => 'select_multiple', - 'BIT' => 'text', - 'TINYINT' => 'number', - 'BOOL' => 'switch', - 'BOOLEAN' => 'switch', - 'SMALLINT' => 'number', - 'MEDIUMINT' => 'number', - 'INT' => 'number', - 'INTEGER' => 'number', - 'BIGINT' => 'number', - 'FLOAT' => 'number', - 'DOUBLE' => 'number', - 'DECIMAL' => 'number', - 'DEC' => 'number', - 'YEAR' => 'number', - 'NUMERIC' => 'number', - 'DOUBLE PRECISION' => 'number', - 'DATETIME' => 'datetime', - 'TIMESTAMP' => 'datetime', - 'TIME' => 'datetime', + 'LONGTEXT' => 'text', + 'LONGBLOB' => 'text', + 'CHARACTER VARYING' => 'text', + 'CHARACTER' => 'text', + 'BYTEA' => 'text', + 'JSON' => 'text', + 'ENUM' => 'select', + 'SET' => 'select_multiple', + 'BIT' => 'text', + 'TINYINT' => 'number', + 'BOOL' => 'switch', + 'BOOLEAN' => 'switch', + 'SMALLINT' => 'number', + 'MEDIUMINT' => 'number', + 'INT' => 'number', + 'INTEGER' => 'number', + 'BIGINT' => 'number', + 'FLOAT' => 'number', + 'DOUBLE' => 'number', + 'DECIMAL' => 'number', + 'DEC' => 'number', + 'YEAR' => 'number', + 'NUMERIC' => 'number', + 'DOUBLE PRECISION' => 'number', + 'DATETIME' => 'datetime', + 'TIMESTAMP' => 'datetime', + 'TIME' => 'datetime', ]; public static function convert($type) diff --git a/src/resources/lang/en/validation.php b/src/resources/lang/en/validation.php index f4dd89d3a..1eced1b16 100644 --- a/src/resources/lang/en/validation.php +++ b/src/resources/lang/en/validation.php @@ -2,42 +2,42 @@ return [ 'auth' => [ - 'invalid_credentials' => 'Invalid email or password', - 'user_not_found' => 'User not found', - 'wrong_old_password' => 'Invalid old password', + 'invalid_credentials' => 'Invalid email or password', + 'user_not_found' => 'User not found', + 'wrong_old_password' => 'Invalid old password', 'password_not_changes' => 'new password must be different with old password', ], 'crud' => [ - 'table_not_found' => 'Table :table does not exists', - 'table_column_not_found' => 'Invalid rows, Field :table_column does not exists', + 'table_not_found' => 'Table :table does not exists', + 'table_column_not_found' => 'Invalid rows, Field :table_column does not exists', 'table_column_not_have_default_value' => 'Invalid rows, Field :table_column has no default value, please tick the checkbox Add', - 'table_deleted_at_not_exists' => 'Invalidate columns deleted_at, please created new columns delete_at in your table :table_name', - 'id_table_wrong' => 'Primary key should be named only "id"', - 'id_not_exist' => '"id" doesn\'t exist', + 'table_deleted_at_not_exists' => 'Invalidate columns deleted_at, please created new columns delete_at in your table :table_name', + 'id_table_wrong' => 'Primary key should be named only "id"', + 'id_not_exist' => '"id" doesn\'t exist', ], 'base64' => [ - 'length_invalid' => 'Base64 format is invalid', - 'header_invalid' => 'Base64 header is invalid', + 'length_invalid' => 'Base64 format is invalid', + 'header_invalid' => 'Base64 header is invalid', 'mimetype_invalid' => 'Base64 mimetype is invalid', ], 'verification' => [ - 'email_sended' => 'An verification mail has been send to your email', + 'email_sended' => 'An verification mail has been send to your email', 'invalid_verification_token' => 'Invalid verification token', - 'verification_not_found' => 'Verification not found', - 'time_wait_loading' => 'Wait until loaded finish', + 'verification_not_found' => 'Verification not found', + 'time_wait_loading' => 'Wait until loaded finish', ], 'database' => [ - 'table_already_exists' => 'Table :table already exists.', + 'table_already_exists' => 'Table :table already exists.', 'table_name_already_exists' => 'Table name of :table already exists.', - 'migration_failed' => 'Migration faield to migrate.', - 'migration_dropped' => 'Table :table successfully dropped.', - 'migration_success' => 'Migration successfully migrated.', - 'migration_deleted' => 'Migration successfully deleted.', - 'alter_migration_created' => 'Alter table :table successfully created and migrated.', - 'table_not_found' => 'Table :table does not exists', - 'nothing_changed' => 'Request was successful, but nothing changed.', - 'rollback_success' => 'Rollback success.', - 'rollback_failed' => 'Rollback failed.', - 'wrong_type_data' => 'Your data type false', + 'migration_failed' => 'Migration faield to migrate.', + 'migration_dropped' => 'Table :table successfully dropped.', + 'migration_success' => 'Migration successfully migrated.', + 'migration_deleted' => 'Migration successfully deleted.', + 'alter_migration_created' => 'Alter table :table successfully created and migrated.', + 'table_not_found' => 'Table :table does not exists', + 'nothing_changed' => 'Request was successful, but nothing changed.', + 'rollback_success' => 'Rollback success.', + 'rollback_failed' => 'Rollback failed.', + 'wrong_type_data' => 'Your data type false', ], ]; diff --git a/src/resources/lang/id/validation.php b/src/resources/lang/id/validation.php index fb818d7c4..971d9ff39 100644 --- a/src/resources/lang/id/validation.php +++ b/src/resources/lang/id/validation.php @@ -2,42 +2,42 @@ return [ 'auth' => [ - 'invalid_credentials' => 'Email atau password tidak valid', - 'user_not_found' => 'Pengguna tidak ditemukan', - 'wrong_old_password' => 'Password lama tidak valid', + 'invalid_credentials' => 'Email atau password tidak valid', + 'user_not_found' => 'Pengguna tidak ditemukan', + 'wrong_old_password' => 'Password lama tidak valid', 'password_not_changes' => 'Password baru dan password lama harus berbeda', ], 'bread' => [ - 'table_not_found' => 'Table :table tidak ditemukan', - 'table_column_not_found' => 'Row tidak valid, Field :table_column tidak ditemukan', + 'table_not_found' => 'Table :table tidak ditemukan', + 'table_column_not_found' => 'Row tidak valid, Field :table_column tidak ditemukan', 'table_column_not_have_default_value' => 'Row tidak valid, Field :table_column tidak punya nilai default, tolong centang checkbox Add', - 'id_table_wrong' => 'Primary Key harus diganti dengan "id"', - 'id_not_exist' => '"id" tidak ditemukan', + 'id_table_wrong' => 'Primary Key harus diganti dengan "id"', + 'id_not_exist' => '"id" tidak ditemukan', ], 'base64' => [ - 'length_invalid' => 'Format base64 tidak valid', - 'header_invalid' => 'Header base64 tidak valid', + 'length_invalid' => 'Format base64 tidak valid', + 'header_invalid' => 'Header base64 tidak valid', 'mimetype_invalid' => 'Mimetype base64 tidak valid', ], 'verification' => [ - 'email_sended' => 'Email verifikasi telah dikirim ke alamat email yang dimasukkan', + 'email_sended' => 'Email verifikasi telah dikirim ke alamat email yang dimasukkan', 'invalid_verification_token' => 'Token verifikasi tidak valid', - 'verification_not_found' => 'Verifikasi tidak ditemukan', - 'time_wait_loading' => 'Tunggu sampai loading selesai', + 'verification_not_found' => 'Verifikasi tidak ditemukan', + 'time_wait_loading' => 'Tunggu sampai loading selesai', ], 'database' => [ - 'table_already_exists' => 'Tabel :table sudah ada.', + 'table_already_exists' => 'Tabel :table sudah ada.', 'table_name_already_exists' => 'Nama tabel dari :table sudah ada.', - 'migration_created' => 'Migration berhasil dibuat dan dijalankan.', - 'migration_failed' => 'Migration gagal dibuat dan dijalankan.', - 'migration_dropped' => 'Tabel :table berhasil dihapus.', - 'migration_success' => 'Migration berhasil dijalankan.', - 'migration_deleted' => 'Migration berhasil dihapus.', - 'alter_migration_created' => 'Alter table :table berhasil dibuat dan dijalankan.', - 'table_not_found' => 'Table :table tidak ada.', - 'nothing_changed' => 'Request valid, namun tidak ada perubahan yang terjadi.', - 'rollback_success' => 'Rollback sukses.', - 'rollback_failed' => 'Rollback gagal.', + 'migration_created' => 'Migration berhasil dibuat dan dijalankan.', + 'migration_failed' => 'Migration gagal dibuat dan dijalankan.', + 'migration_dropped' => 'Tabel :table berhasil dihapus.', + 'migration_success' => 'Migration berhasil dijalankan.', + 'migration_deleted' => 'Migration berhasil dihapus.', + 'alter_migration_created' => 'Alter table :table berhasil dibuat dan dijalankan.', + 'table_not_found' => 'Table :table tidak ada.', + 'nothing_changed' => 'Request valid, namun tidak ada perubahan yang terjadi.', + 'rollback_success' => 'Rollback sukses.', + 'rollback_failed' => 'Rollback gagal.', ], ]; diff --git a/tests/Feature/BadasoApiCrudManagementTest.php b/tests/Feature/BadasoApiCrudManagementTest.php index 5b378ca5f..b7102a1b0 100644 --- a/tests/Feature/BadasoApiCrudManagementTest.php +++ b/tests/Feature/BadasoApiCrudManagementTest.php @@ -690,23 +690,23 @@ class {$controller_name} extends \Uasoft\Badaso\Controllers\BadasoBaseController $table_label = ucwords(str_replace(['_'], ' ', $table_name)); $request_body = [ - 'name' => $table_name, - 'slug' => $table_name, - 'displayNameSingular' => $table_label, - 'displayNamePlural' => $table_label, - 'icon' => 'add', - 'modelName' => $model, - 'policyName' => '', + 'name' => $table_name, + 'slug' => $table_name, + 'displayNameSingular' => $table_label, + 'displayNamePlural' => $table_label, + 'icon' => 'add', + 'modelName' => $model, + 'policyName' => '', 'description' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', - 'generatePermissions' => rand(0, 1), - 'createSoftDelete' => rand(0, 1), - 'serverSide' => rand(0, 1), - 'details' => json_encode((object) []), - 'controller' => $controller, - 'orderColumn' => '', - 'orderDisplayColumn' => '', - 'orderDirection' => '', - 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 3)), + 'generatePermissions' => rand(0, 1), + 'createSoftDelete' => rand(0, 1), + 'serverSide' => rand(0, 1), + 'details' => json_encode((object) []), + 'controller' => $controller, + 'orderColumn' => '', + 'orderDisplayColumn' => '', + 'orderDirection' => '', + 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 3)), 'isMaintenance' => rand(0, 1), 'rows' => $rows, ]; @@ -1704,23 +1704,23 @@ class {$controller_name} extends \Uasoft\Badaso\Controllers\BadasoBaseController $table_label = ucwords(str_replace(['_'], ' ', $table_name)); $request_body = [ - 'name' => $table_name, - 'slug' => $table_name, - 'displayNameSingular' => $table_label, - 'displayNamePlural' => $table_label, - 'icon' => 'add', - 'modelName' => $model, - 'policyName' => '', + 'name' => $table_name, + 'slug' => $table_name, + 'displayNameSingular' => $table_label, + 'displayNamePlural' => $table_label, + 'icon' => 'add', + 'modelName' => $model, + 'policyName' => '', 'description' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', - 'generatePermissions' => rand(0, 1), - 'createSoftDelete' => rand(0, 1), - 'serverSide' => rand(0, 1), - 'details' => json_encode((object) []), - 'controller' => $controller, - 'orderColumn' => '', - 'orderDisplayColumn' => '', - 'orderDirection' => '', - 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 3)), + 'generatePermissions' => rand(0, 1), + 'createSoftDelete' => rand(0, 1), + 'serverSide' => rand(0, 1), + 'details' => json_encode((object) []), + 'controller' => $controller, + 'orderColumn' => '', + 'orderDisplayColumn' => '', + 'orderDirection' => '', + 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 3)), 'isMaintenance' => rand(0, 1), 'rows' => $rows, ]; @@ -1968,23 +1968,23 @@ public function testBrowseIsPublicPermissionEntity() ]; $table_label = ucwords(str_replace(['_'], ' ', $table_name)); $request_body = [ - 'name' => $table_name, - 'slug' => $table_name, - 'displayNameSingular' => $table_label, - 'displayNamePlural' => $table_label, - 'icon' => 'add', - 'modelName' => '', - 'policyName' => '', + 'name' => $table_name, + 'slug' => $table_name, + 'displayNameSingular' => $table_label, + 'displayNamePlural' => $table_label, + 'icon' => 'add', + 'modelName' => '', + 'policyName' => '', 'description' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.', - 'generatePermissions' => 1, - 'createSoftDelete' => rand(0, 1), - 'serverSide' => rand(0, 1), - 'details' => json_encode((object) []), - 'controller' => '', - 'orderColumn' => '', - 'orderDisplayColumn' => '', - 'orderDirection' => '', - 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 3)), + 'generatePermissions' => 1, + 'createSoftDelete' => rand(0, 1), + 'serverSide' => rand(0, 1), + 'details' => json_encode((object) []), + 'controller' => '', + 'orderColumn' => '', + 'orderDisplayColumn' => '', + 'orderDirection' => '', + 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 3)), 'isMaintenance' => rand(0, 1), 'rows' => $rows, ]; @@ -1997,9 +1997,9 @@ public function testBrowseIsPublicPermissionEntity() $permission_id = $value->id; } $request_data = [ - 'always_allow' => false, - 'description' => Str::uuid(), - 'is_public' => true, + 'always_allow' => false, + 'description' => Str::uuid(), + 'is_public' => true, 'key' => 'browse_'.$table_name, 'id' => $permission_id, ]; @@ -2182,23 +2182,23 @@ class {$controller_name} extends \Uasoft\Badaso\Controllers\BadasoBaseController $data_table_crud_management_log[$index]['controller'] = $controller_data; $request_body = [ - 'name' => $table_name, - 'slug' => $table_name, - 'displayNameSingular' => $table_label.'(update)', - 'displayNamePlural' => $table_label.'(update)', - 'icon' => 'add', - 'modelName' => $model, - 'policyName' => '', + 'name' => $table_name, + 'slug' => $table_name, + 'displayNameSingular' => $table_label.'(update)', + 'displayNamePlural' => $table_label.'(update)', + 'icon' => 'add', + 'modelName' => $model, + 'policyName' => '', 'description' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. (update)', - 'generatePermissions' => rand(0, 1), - 'createSoftDelete' => rand(0, 1), - 'serverSide' => rand(0, 1), - 'details' => json_encode((object) []), - 'controller' => $controller, - 'orderColumn' => '', - 'orderDisplayColumn' => '', - 'orderDirection' => '', - 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 0)), + 'generatePermissions' => rand(0, 1), + 'createSoftDelete' => rand(0, 1), + 'serverSide' => rand(0, 1), + 'details' => json_encode((object) []), + 'controller' => $controller, + 'orderColumn' => '', + 'orderDisplayColumn' => '', + 'orderDirection' => '', + 'notification' => array_slice(['onCreate', 'onDelete', 'onUpdate', 'onRead'], 0, rand(0, 0)), 'rows' => $rows, ]; diff --git a/tests/Feature/BadasoApiMenuItemTest.php b/tests/Feature/BadasoApiMenuItemTest.php index 4c09567f6..4b752d1d2 100644 --- a/tests/Feature/BadasoApiMenuItemTest.php +++ b/tests/Feature/BadasoApiMenuItemTest.php @@ -83,14 +83,14 @@ public function testMenuItemAdd() $menus = Menu::all(); foreach ($menus as $index => $menu) { $request_data = [ - 'menuId' => $menu->id, - 'title' => Str::random(10), - 'url' => Str::random(10), - 'target' => '_self', - 'iconClass' => 'add', - 'color' => '#FFFFFF', - 'parentId' => null, - 'order' => null, + 'menuId' => $menu->id, + 'title' => Str::random(10), + 'url' => Str::random(10), + 'target' => '_self', + 'iconClass' => 'add', + 'color' => '#FFFFFF', + 'parentId' => null, + 'order' => null, ]; $response = CallHelperTest::withAuthorizeBearer($this)->json('POST', CallHelperTest::getUrlApiV1Prefix('/menus/item/add'), $request_data); $response->assertSuccessful(); @@ -125,12 +125,12 @@ public function testMenuItemEdit() foreach ($data_created_menu_items as $key => ['menu_id' => $menu_id, 'menu_item_id' => $menu_item_id]) { $request_data = [ 'menuItemId' => $menu_item_id, - 'menuId' => $menu_id, - 'title' => Str::random(10), - 'url' => '/'.Str::random(10), - 'target' => '_self', - 'iconClass' => 'add', - 'color' => '#OOOOOO', + 'menuId' => $menu_id, + 'title' => Str::random(10), + 'url' => '/'.Str::random(10), + 'target' => '_self', + 'iconClass' => 'add', + 'color' => '#OOOOOO', ]; $response = CallHelperTest::withAuthorizeBearer($this)->json('PUT', CallHelperTest::getUrlApiV1Prefix('/menus/item/edit'), $request_data); @@ -207,8 +207,8 @@ public function testMenuItemDelete() $data_created_menu_items = CallHelperTest::getCache(self::$KEY_DATA_CREATED_MENU_ITEMS); foreach ($data_created_menu_items as $key => ['menu_id' => $menu_id, 'menu_item_id' => $menu_item_id]) { $response = CallHelperTest::withAuthorizeBearer($this)->json('DELETE', CallHelperTest::getUrlApiV1Prefix('/menus/item/delete'), [ - 'menuId' => $menu_id, - 'menuItemId' => $menu_item_id, + 'menuId' => $menu_id, + 'menuItemId' => $menu_item_id, ]); $response->assertSuccessful(); @@ -231,12 +231,12 @@ public function testMenuItemGetPermission() $menu_id = $menu->id; $create_data = [ - 'menu_id' => $menu_id, - 'title' => Str::random(10), - 'url' => Str::random(10), - 'target' => '_self', - 'icon_class' => 'add', - 'color' => '#FFFFFF', + 'menu_id' => $menu_id, + 'title' => Str::random(10), + 'url' => Str::random(10), + 'target' => '_self', + 'icon_class' => 'add', + 'color' => '#FFFFFF', 'order' => 1, 'permissions' => $permissions, ]; @@ -280,12 +280,12 @@ public function testMenuItemEditPermission() $menu_id = $menu->id; $create_data = [ - 'menu_id' => $menu_id, - 'title' => Str::random(10), - 'url' => Str::random(10), - 'target' => '_self', - 'icon_class' => 'add', - 'color' => '#FFFFFF', + 'menu_id' => $menu_id, + 'title' => Str::random(10), + 'url' => Str::random(10), + 'target' => '_self', + 'icon_class' => 'add', + 'color' => '#FFFFFF', 'order' => 1, 'permissions' => null, ]; diff --git a/tests/Feature/BadasoApiPermissionTest.php b/tests/Feature/BadasoApiPermissionTest.php index 388148eb6..4599101eb 100644 --- a/tests/Feature/BadasoApiPermissionTest.php +++ b/tests/Feature/BadasoApiPermissionTest.php @@ -44,10 +44,10 @@ public function testReadPermission() public function testAddPermission() { $request_data = [ - 'always_allow' => true, - 'description' => Str::uuid(), - 'is_public' => true, - 'key' => Str::uuid(), + 'always_allow' => true, + 'description' => Str::uuid(), + 'is_public' => true, + 'key' => Str::uuid(), ]; $response = CallHelperTest::withAuthorizeBearer($this)->json('POST', CallHelperTest::getUrlApiV1Prefix('/permissions/add'), $request_data); @@ -68,10 +68,10 @@ public function testEditPermission() { $permission_id = CallHelperTest::getCache(self::$KEY_PERMISSION_LAST_CREATED_ID); $request_data = [ - 'always_allow' => true, - 'description' => Str::uuid(), - 'is_public' => true, - 'key' => Str::uuid(), + 'always_allow' => true, + 'description' => Str::uuid(), + 'is_public' => true, + 'key' => Str::uuid(), 'id' => $permission_id, ]; @@ -106,10 +106,10 @@ public function testDeleteMultiplePermission() $ids = []; for ($i = 1; $i <= $maximal_count; $i++) { $request_data = [ - 'always_allow' => true, - 'description' => Str::uuid(), - 'is_public' => true, - 'key' => Str::uuid(), + 'always_allow' => true, + 'description' => Str::uuid(), + 'is_public' => true, + 'key' => Str::uuid(), ]; $response = CallHelperTest::withAuthorizeBearer($this)->json('POST', CallHelperTest::getUrlApiV1Prefix('/permissions/add'), $request_data);