Fix backend code styling

This commit is contained in:
MakingCG
2021-07-17 18:38:41 +00:00
committed by GitHub Actions
parent 9ba3d9a6ba
commit ec6d11b7ae
91 changed files with 1732 additions and 1737 deletions
+20 -20
View File
@@ -20,15 +20,15 @@ class DemoService
public function create_folder($request)
{
return [
'user_id' => 1,
'id' => Str::uuid(),
'parent_id' => random_int(1000, 9999),
'name' => $request->name,
'type' => 'folder',
'author' => $request->user() ? 'user' : 'visitor',
'items' => '0',
'color' => isset($request->icon['color']) ? $request->icon['color'] : null,
'emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
'user_id' => 1,
'id' => Str::uuid(),
'parent_id' => random_int(1000, 9999),
'name' => $request->name,
'type' => 'folder',
'author' => $request->user() ? 'user' : 'visitor',
'items' => '0',
'color' => isset($request->icon['color']) ? $request->icon['color'] : null,
'emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
'updated_at' => now()->format('j M Y \a\t H:i'),
'created_at' => now()->format('j M Y \a\t H:i'),
];
@@ -63,7 +63,7 @@ class DemoService
}
return [
'id' => $request->id,
'id' => $request->id,
'name' => $request->name,
'type' => $request->type,
];
@@ -86,16 +86,16 @@ class DemoService
$filetype = get_file_type($file->getMimeType());
return [
'id' => Str::uuid(),
'folder_id' => $request->parent_id,
'thumbnail' => 'data:' . $request->file('file')->getMimeType() . ';base64, ' . base64_encode(file_get_contents($request->file('file'))),
'name' => $file->getClientOriginalName(),
'basename' => $filename,
'mimetype' => $file->getClientOriginalExtension(),
'filesize' => Metric::bytes($filesize)->format(),
'type' => $filetype,
'file_url' => 'https://vuefilemanager.hi5ve.digital/assets/vue-file-manager-preview.jpg',
'author' => $request->user() ? 'user' : 'visitor',
'id' => Str::uuid(),
'folder_id' => $request->parent_id,
'thumbnail' => 'data:' . $request->file('file')->getMimeType() . ';base64, ' . base64_encode(file_get_contents($request->file('file'))),
'name' => $file->getClientOriginalName(),
'basename' => $filename,
'mimetype' => $file->getClientOriginalExtension(),
'filesize' => Metric::bytes($filesize)->format(),
'type' => $filetype,
'file_url' => 'https://vuefilemanager.hi5ve.digital/assets/vue-file-manager-preview.jpg',
'author' => $request->user() ? 'user' : 'visitor',
'created_at' => now()->format('j M Y \a\t H:i'),
'updated_at' => now()->format('j M Y \a\t H:i'),
];
+17 -17
View File
@@ -88,9 +88,9 @@ class FileManagerService
// Store zip record
return Zip::create([
'user_id' => $shared->user_id ?? Auth::id(),
'user_id' => $shared->user_id ?? Auth::id(),
'shared_token' => $shared->token ?? null,
'basename' => $zip_name,
'basename' => $zip_name,
]);
}
@@ -146,9 +146,9 @@ class FileManagerService
// Store zip record
return Zip::create([
'user_id' => $shared->user_id ?? Auth::id(),
'user_id' => $shared->user_id ?? Auth::id(),
'shared_token' => $shared->token ?? null,
'basename' => $zip_name,
'basename' => $zip_name,
]);
}
@@ -163,11 +163,11 @@ class FileManagerService
{
return Folder::create([
'parent_id' => $request->parent_id,
'author' => $shared ? 'visitor' : 'user',
'user_id' => $shared ? $shared->user_id : Auth::id(),
'name' => $request->name,
'color' => $request->color ?? null,
'emoji' => $request->emoji ?? null,
'author' => $shared ? 'visitor' : 'user',
'user_id' => $shared ? $shared->user_id : Auth::id(),
'name' => $request->name,
'color' => $request->color ?? null,
'emoji' => $request->emoji ?? null,
]);
}
@@ -397,16 +397,16 @@ class FileManagerService
// Return new file
return UserFile::create([
'mimetype' => get_file_type_from_mimetype($file_mimetype),
'type' => get_file_type($file_mimetype),
'mimetype' => get_file_type_from_mimetype($file_mimetype),
'type' => get_file_type($file_mimetype),
'folder_id' => $request->folder_id,
'metadata' => $metadata,
'name' => $request->filename,
'basename' => $disk_file_name,
'author' => $shared ? 'visitor' : 'user',
'metadata' => $metadata,
'name' => $request->filename,
'basename' => $disk_file_name,
'author' => $shared ? 'visitor' : 'user',
'thumbnail' => $thumbnail,
'filesize' => $file_size,
'user_id' => $user_id,
'filesize' => $file_size,
'user_id' => $user_id,
]);
}
}
+5 -5
View File
@@ -145,7 +145,7 @@ class HelperService
// TODO: replace local files with temp folder
$uploader = new MultipartUploader($client, config('filesystems.disks.local.root') . "/files/$user_id/$file", [
'bucket' => $adapter->getBucket(),
'key' => "files/$user_id/$file",
'key' => "files/$user_id/$file",
]);
try {
@@ -228,10 +228,10 @@ class HelperService
return response()
->download(Storage::path($path), $pretty_name, [
'Accept-Ranges' => 'bytes',
'Content-Type' => Storage::mimeType($path),
'Content-Length' => Storage::size($path),
'Content-Range' => 'bytes 0-600/' . Storage::size($path),
'Accept-Ranges' => 'bytes',
'Content-Type' => Storage::mimeType($path),
'Content-Length' => Storage::size($path),
'Content-Range' => 'bytes 0-600/' . Storage::size($path),
'Content-Disposition' => "attachment; filename=$pretty_name",
]);
}
+4 -4
View File
@@ -28,9 +28,9 @@ class LanguageService
$translations = $translations[strtolower($license)]
->map(function ($value, $key) use ($locale) {
return [
'lang' => $locale,
'lang' => $locale,
'value' => $value,
'key' => $key,
'key' => $key,
];
})->toArray();
@@ -79,9 +79,9 @@ class LanguageService
$translations = $newbies
->map(function ($value, $key) use ($locale) {
return [
'lang' => $locale,
'lang' => $locale,
'value' => $value,
'key' => $key,
'key' => $key,
];
})->toArray();
+2 -2
View File
@@ -56,12 +56,12 @@ class SetupService
public function seed_default_language()
{
Language::create([
'name' => 'English',
'name' => 'English',
'locale' => 'en',
]);
Setting::create([
'name' => 'language',
'name' => 'language',
'value' => 'en',
]);
}
+24 -24
View File
@@ -69,10 +69,10 @@ class StripeService
$tax = $amount * ($rate['percentage'] / 100);
array_push($rates_public, [
'id' => $rate['id'],
'active' => $rate['active'],
'country' => $rate['country'],
'percentage' => $rate['percentage'],
'id' => $rate['id'],
'active' => $rate['active'],
'country' => $rate['country'],
'percentage' => $rate['percentage'],
'plan_price_formatted' => Cashier::formatAmount(round($amount + $tax)),
]);
}
@@ -174,14 +174,14 @@ class StripeService
public function updateCustomerDetails($user)
{
$user->updateStripeCustomer([
'name' => $user->settings->name,
'phone' => $user->settings->phone_number,
'name' => $user->settings->name,
'phone' => $user->settings->phone_number,
'address' => [
'line1' => $user->settings->address,
'city' => $user->settings->city,
'country' => $user->settings->country,
'line1' => $user->settings->address,
'city' => $user->settings->city,
'country' => $user->settings->country,
'postal_code' => $user->settings->postal_code,
'state' => $user->settings->state,
'state' => $user->settings->state,
],
'preferred_locales' => [
$user->settings->country, 'en',
@@ -211,7 +211,7 @@ class StripeService
// Push data to $plan container
if ($product['active'] && isset($product['metadata']['capacity'])) {
array_push($plans, [
'plan' => $plan,
'plan' => $plan,
'product' => $product,
]);
}
@@ -243,7 +243,7 @@ class StripeService
// Push data to $plan container
if ($product['active'] && isset($product['metadata']['capacity'])) {
array_push($plans, [
'plan' => $plan,
'plan' => $plan,
'product' => $product,
]);
}
@@ -270,7 +270,7 @@ class StripeService
$product = $this->stripe->products()->find($plan['product']);
return [
'plan' => $plan,
'plan' => $plan,
'product' => $product,
];
});
@@ -286,34 +286,34 @@ class StripeService
{
if ($data instanceof Request) {
$plan = [
'name' => $data->input('attributes.name'),
'name' => $data->input('attributes.name'),
'description' => $data->input('attributes.description'),
'price' => $data->input('attributes.price'),
'capacity' => $data->input('attributes.capacity'),
'price' => $data->input('attributes.price'),
'capacity' => $data->input('attributes.capacity'),
];
} else {
$plan = [
'name' => $data['attributes']['name'],
'name' => $data['attributes']['name'],
'description' => $data['attributes']['description'],
'price' => $data['attributes']['price'],
'capacity' => $data['attributes']['capacity'],
'price' => $data['attributes']['price'],
'capacity' => $data['attributes']['capacity'],
];
}
$product = $this->stripe->products()->create([
'name' => $plan['name'],
'name' => $plan['name'],
'description' => $plan['description'],
'metadata' => [
'metadata' => [
'capacity' => $plan['capacity'],
],
]);
$plan = $this->stripe->plans()->create([
'id' => Str::slug($plan['name']),
'amount' => $plan['price'],
'id' => Str::slug($plan['name']),
'amount' => $plan['price'],
'currency' => config('cashier.currency'),
'interval' => 'month',
'product' => $product['id'],
'product' => $product['id'],
]);
return compact('plan', 'product');