Explorar o código

Merge pull request #339 from IceToast/servers-servercard

servers card UI redesign
Dennis %!s(int64=3) %!d(string=hai) anos
pai
achega
5b7374d41a

+ 1 - 0
.gitignore

@@ -20,3 +20,4 @@ yarn-error.log
 .env.testing
 storage/invoices.zip
 storage/app/public/logo.png
+*vscode

+ 6 - 0
CONTRIBUTING.md

@@ -4,6 +4,12 @@ When contributing to this repository, please go through the open issues to see i
 
 Please note we have a code of conduct, please follow it in all your interactions with the project.
 
+If you added any Strings which are displayed at the frontend please localize them (e.g. "New String" -> {{ __('New String') }}) and run the localization string generation:
+
+```cmd
+php artisan translatable:export en
+```
+
 ## Pull request process
 
 1. Give your PR a good descriptive title, so we can view immediately what the PR is about.

+ 62 - 11
app/Classes/Pterodactyl.php

@@ -17,7 +17,7 @@ class Pterodactyl
     /**
      * @description per_page option to pull more than the default 50 from pterodactyl
      */
-    public CONST PER_PAGE = 200;
+    public const PER_PAGE = 200;
 
     //TODO: Extend error handling (maybe logger for more errors when debugging)
 
@@ -48,7 +48,11 @@ class Pterodactyl
      */
     public static function getEggs(Nest $nest)
     {
-        $response = self::client()->get("/application/nests/{$nest->id}/eggs?include=nest,variables&per_page=" . self::PER_PAGE);
+        try {
+            $response = self::client()->get("/application/nests/{$nest->id}/eggs?include=nest,variables&per_page=" . self::PER_PAGE);
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
         return $response->json()['data'];
     }
@@ -59,7 +63,11 @@ class Pterodactyl
      */
     public static function getNodes()
     {
-        $response = self::client()->get('/application/nodes?per_page=' . self::PER_PAGE);
+        try {
+            $response = self::client()->get('/application/nodes?per_page=' . self::PER_PAGE);
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
         return $response->json()['data'];
     }
@@ -70,7 +78,11 @@ class Pterodactyl
      */
     public static function getNests()
     {
-        $response = self::client()->get('/application/nests?per_page=' . self::PER_PAGE);
+        try {
+            $response = self::client()->get('/application/nests?per_page=' . self::PER_PAGE);
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
         return $response->json()['data'];
     }
@@ -81,8 +93,13 @@ class Pterodactyl
      */
     public static function getLocations()
     {
-        $response = self::client()->get('/application/locations?per_page=' . self::PER_PAGE);
+        try {
+            $response = self::client()->get('/application/locations?per_page=' . self::PER_PAGE);
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
+
         return $response->json()['data'];
     }
 
@@ -125,8 +142,13 @@ class Pterodactyl
     public static function getAllocations(Node $node)
     {
         $per_page = Configuration::getValueByKey('ALLOCATION_LIMIT', 200);
-        $response = self::client()->get("/application/nodes/{$node->id}/allocations?per_page={$per_page}");
+        try {
+            $response = self::client()->get("/application/nodes/{$node->id}/allocations?per_page={$per_page}");
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
+
         return $response->json();
     }
 
@@ -171,20 +193,29 @@ class Pterodactyl
                 "default" => $allocationId
             ]
         ]);
-
     }
 
     public static function suspendServer(Server $server)
     {
-        $response = self::client()->post("/application/servers/$server->pterodactyl_id/suspend");
+        try {
+            $response = self::client()->post("/application/servers/$server->pterodactyl_id/suspend");
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
+
         return $response;
     }
 
     public static function unSuspendServer(Server $server)
     {
-        $response = self::client()->post("/application/servers/$server->pterodactyl_id/unsuspend");
+        try {
+            $response = self::client()->post("/application/servers/$server->pterodactyl_id/unsuspend");
+        } catch (Exception $e) {
+            throw self::getException();
+        }
         if ($response->failed()) throw self::getException();
+
         return $response;
     }
 
@@ -195,9 +226,29 @@ class Pterodactyl
      */
     public function getUser(int $pterodactylId)
     {
-        $response = self::client()->get("/application/users/{$pterodactylId}");
+        try {
+            $response = self::client()->get("/application/users/{$pterodactylId}");
+        } catch (Exception $e) {
+            throw self::getException();
+        }
+        if ($response->failed()) throw self::getException();
+
+        return $response->json()['attributes'];
+    }
 
-        if ($response->failed()) return $response->json();
+    /**
+     * Get serverAttributes by pterodactyl id
+     * @param int $pterodactylId
+     * @return mixed
+     */
+    public static function getServerAttributes(string $pterodactylId)
+    {
+        try {
+            $response = self::client()->get("/application/servers/{$pterodactylId}?include=egg,node,nest,location");
+        } catch (Exception $e) {
+            throw self::getException();
+        }
+        if ($response->failed()) throw self::getException();
         return $response->json()['attributes'];
     }
 }

+ 31 - 3
app/Http/Controllers/ServerController.php

@@ -24,8 +24,35 @@ class ServerController extends Controller
     /** Display a listing of the resource. */
     public function index()
     {
+        $servers = Auth::user()->servers;
+
+        //Get and set server infos each server
+        foreach ($servers as $server) {
+
+            //Get server infos from ptero
+            $serverAttributes = Pterodactyl::getServerAttributes($server->pterodactyl_id);
+
+            $serverRelationships = $serverAttributes['relationships'];
+            $serverLocationAttributes = $serverRelationships['location']['attributes'];
+
+            //Set server infos
+            $server->location = $serverLocationAttributes['long'] ?
+                $serverLocationAttributes['long'] :
+                $serverLocationAttributes['short'];
+
+            $server->egg = $serverRelationships['egg']['attributes']['name'];
+            $server->nest = $serverRelationships['nest']['attributes']['name'];
+
+            $server->node = $serverRelationships['node']['attributes']['name'];
+
+            //get productname by product_id for server
+            $product = Product::find($server->product_id);
+
+            $server->product = $product;
+        }
+
         return view('servers.index')->with([
-            'servers' => Auth::user()->Servers
+            'servers' => $servers
         ]);
     }
 
@@ -134,10 +161,11 @@ class ServerController extends Controller
         $response = Pterodactyl::createServer($server, $egg, $allocationId);
         if ($response->failed()) return $this->serverCreationFailed($response, $server);
 
+        $serverAttributes = $response->json()['attributes'];
         //update server with pterodactyl_id
         $server->update([
-            'pterodactyl_id' => $response->json()['attributes']['id'],
-            'identifier'     => $response->json()['attributes']['identifier']
+            'pterodactyl_id' => $serverAttributes['id'],
+            'identifier'     => $serverAttributes['identifier']
         ]);
 
         if (Configuration::getValueByKey('SERVER_CREATE_CHARGE_FIRST_HOUR', 'true') == 'true') {

+ 1 - 0
composer.json

@@ -16,6 +16,7 @@
         "fruitcake/laravel-cors": "^2.0",
         "guzzlehttp/guzzle": "^7.0.1",
         "hidehalo/nanoid-php": "^1.1",
+        "kkomelin/laravel-translatable-string-exporter": "^1.14",
         "laravel/framework": "^8.12",
         "laravel/tinker": "^2.5",
         "laravel/ui": "^3.2",

+ 62 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "2d4d66f2322f8c630c609cf446f7c402",
+    "content-hash": "ed0357bbf827f4e6078d2ed41ce3fa17",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -1697,6 +1697,67 @@
             },
             "time": "2020-12-11T09:24:45+00:00"
         },
+        {
+            "name": "kkomelin/laravel-translatable-string-exporter",
+            "version": "1.14.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/kkomelin/laravel-translatable-string-exporter.git",
+                "reference": "9dce1e5f8ed59a1b58e77ec7d84f1427d5e29f0a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/kkomelin/laravel-translatable-string-exporter/zipball/9dce1e5f8ed59a1b58e77ec7d84f1427d5e29f0a",
+                "reference": "9dce1e5f8ed59a1b58e77ec7d84f1427d5e29f0a",
+                "shasum": ""
+            },
+            "require": {
+                "ext-json": "*",
+                "illuminate/support": "^5.4|^6|^7|^8",
+                "illuminate/translation": "^5.4|^6|^7|^8",
+                "php": ">=5.4.0",
+                "symfony/finder": "^3.2|^4|^5"
+            },
+            "require-dev": {
+                "orchestra/testbench": "^3.4|^4.0|^5.0|^6.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "KKomelin\\TranslatableStringExporter\\Providers\\ExporterServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "KKomelin\\TranslatableStringExporter\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Konstantin Komelin",
+                    "email": "konstantin.komelin@gmail.com"
+                }
+            ],
+            "description": "Translatable String Exporter for Laravel",
+            "keywords": [
+                "export",
+                "exporter",
+                "json",
+                "laravel",
+                "translations"
+            ],
+            "support": {
+                "issues": "https://github.com/kkomelin/laravel-translatable-string-exporter/issues",
+                "source": "https://github.com/kkomelin/laravel-translatable-string-exporter/tree/1.14.0"
+            },
+            "time": "2021-08-08T06:48:21+00:00"
+        },
         {
             "name": "laravel/framework",
             "version": "v8.76.2",

+ 3 - 0
config/app.php

@@ -193,6 +193,9 @@ return [
         App\Providers\RouteServiceProvider::class,
         Yajra\DataTables\DataTablesServiceProvider::class,
 
+        KKomelin\TranslatableStringExporter\Providers\ExporterServiceProvider::class,
+
+
     ],
 
     /*

+ 186 - 207
resources/lang/en.json

@@ -1,100 +1,170 @@
 {
+    "api key created!": "api key created!",
+    "api key updated!": "api key updated!",
+    "api key has been removed!": "api key has been removed!",
+    "Edit": "Edit",
+    "Delete": "Delete",
+    "configuration has been updated!": "configuration has been updated!",
+    "Store item has been created!": "Store item has been created!",
+    "Store item has been updated!": "Store item has been updated!",
+    "Product has been updated!": "Product has been updated!",
+    "Store item has been removed!": "Store item has been removed!",
+    "unknown": "unknown",
+    "Pterodactyl synced": "Pterodactyl synced",
+    "Your credit balance has been increased!": "Your credit balance has been increased!",
+    "Your payment is being processed!": "Your payment is being processed!",
+    "Your payment has been canceled!": "Your payment has been canceled!",
+    "Payment method": "Payment method",
+    "Invoice": "Invoice",
+    "Product has been created!": "Product has been created!",
+    "Product has been removed!": "Product has been removed!",
+    "Show": "Show",
+    "Clone": "Clone",
+    "Server removed": "Server removed",
+    "An exception has occurred while trying to remove a resource \"": "An exception has occurred while trying to remove a resource \"",
+    "Server has been updated!": "Server has been updated!",
+    "Unsuspend": "Unsuspend",
+    "Suspend": "Suspend",
+    "Icons updated!": "Icons updated!",
+    "link has been created!": "link has been created!",
+    "link has been updated!": "link has been updated!",
+    "product has been removed!": "product has been removed!",
+    "User does not exists on pterodactyl's panel": "User does not exists on pterodactyl's panel",
+    "user has been removed!": "user has been removed!",
+    "Notification sent!": "Notification sent!",
+    "User has been updated!": "User has been updated!",
+    "Login as User": "Login as User",
+    "voucher has been created!": "voucher has been created!",
+    "voucher has been updated!": "voucher has been updated!",
+    "voucher has been removed!": "voucher has been removed!",
+    "This voucher has reached the maximum amount of uses": "This voucher has reached the maximum amount of uses",
+    "This voucher has expired": "This voucher has expired",
+    "You already redeemed this voucher code": "You already redeemed this voucher code",
+    "have been added to your balance!": "have been added to your balance!",
+    "Users": "Users",
+    "VALID": "VALID",
+    "days": "days",
+    "hours": "hours",
+    "You ran out of Credits": "You ran out of Credits",
+    "Profile updated": "Profile updated",
+    "Server limit reached!": "Server limit reached!",
+    "You are required to verify your email address before you can create a server.": "You are required to verify your email address before you can create a server.",
+    "You are required to link your discord account before you can create a server.": "You are required to link your discord account before you can create a server.",
+    "Server created": "Server created",
+    "No allocations satisfying the requirements for automatic deployment on this node were found.": "No allocations satisfying the requirements for automatic deployment on this node were found.",
+    "You are required to verify your email address before you can purchase credits.": "You are required to verify your email address before you can purchase credits.",
+    "You are required to link your discord account before you can purchase Credits": "You are required to link your discord account before you can purchase Credits",
+    "EXPIRED": "EXPIRED",
+    "Payment Confirmation": "Payment Confirmation",
+    "Payment Confirmed!": "Payment Confirmed!",
+    "Your Payment was successful!": "Your Payment was successful!",
+    "Hello": "Hello",
+    "Your payment was processed successfully!": "Your payment was processed successfully!",
+    "Status": "Status",
+    "Price": "Price",
+    "Type": "Type",
+    "Amount": "Amount",
+    "Balance": "Balance",
+    "User ID": "User ID",
+    "Server Creation Error": "Server Creation Error",
+    "Your servers have been suspended!": "Your servers have been suspended!",
+    "To automatically re-enable your server\/s, you need to purchase more credits.": "To automatically re-enable your server\/s, you need to purchase more credits.",
+    "Purchase credits": "Purchase credits",
+    "If you have any questions please let us know.": "If you have any questions please let us know.",
+    "Regards": "Regards",
+    "Getting started!": "Getting started!",
     "Activity Logs": "Activity Logs",
+    "Dashboard": "Dashboard",
     "No recent activity from cronjobs": "No recent activity from cronjobs",
-    "Check the docs for it here": "Check the docs for it here",
     "Are cronjobs running?": "Are cronjobs running?",
+    "Check the docs for it here": "Check the docs for it here",
     "Causer": "Causer",
     "Description": "Description",
     "Created at": "Created at",
-
+    "Application API": "Application API",
+    "Create": "Create",
+    "Memo": "Memo",
+    "Submit": "Submit",
+    "Create new": "Create new",
+    "Token": "Token",
+    "Last used": "Last used",
+    "Are you sure you wish to delete?": "Are you sure you wish to delete?",
     "Edit Configuration": "Edit Configuration",
     "Text Field": "Text Field",
     "Cancel": "Cancel",
-    "Close": "Close",
     "Save": "Save",
-    "true": "true",
-    "false": "false",
-
     "Configurations": "Configurations",
-    "Dashboard": "Dashboard",
     "Key": "Key",
     "Value": "Value",
-    "Type": "Type",
-
+    "Nests": "Nests",
+    "Sync": "Sync",
+    "Active": "Active",
+    "ID": "ID",
+    "eggs": "eggs",
+    "Name": "Name",
+    "Nodes": "Nodes",
+    "Location": "Location",
     "Admin Overview": "Admin Overview",
     "Support server": "Support server",
     "Documentation": "Documentation",
     "Github": "Github",
     "Support ControlPanel": "Support ControlPanel",
     "Servers": "Servers",
-    "Users": "Users",
     "Total": "Total",
     "Payments": "Payments",
     "Pterodactyl": "Pterodactyl",
-    "Sync": "Sync",
     "Resources": "Resources",
     "Count": "Count",
     "Locations": "Locations",
-    "Node": "Node",
-    "Nodes": "Nodes",
-    "Nests": "Nests",
     "Eggs": "Eggs",
     "Last updated :date": "Last updated :date",
-    "Purchase": "Purchase",
-
-    "ID": "ID",
-    "User": "User",
-    "Amount": "Amount",
     "Product Price": "Product Price",
-    "Tax": "Tax",
+    "Tax Value": "Tax Value",
+    "Tax Percentage": "Tax Percentage",
     "Total Price": "Total Price",
-    "Payment_ID": "Payment_ID",
-    "Payer_ID": "Payer_ID",
-
-    "Product": "Product",
+    "Payment ID": "Payment ID",
+    "Payment Method": "Payment Method",
     "Products": "Products",
-    "Create": "Create",
     "Product Details": "Product Details",
-    "Server Details": "Server Details",
-
-    "Product Linking": "Product Linking",
-    "Name": "Name",
+    "Disabled": "Disabled",
+    "Will hide this option from being selected": "Will hide this option from being selected",
     "Price in": "Price in",
     "Memory": "Memory",
     "Cpu": "Cpu",
     "Swap": "Swap",
+    "This is what the users sees": "This is what the users sees",
     "Disk": "Disk",
     "Minimum": "Minimum",
+    "Setting to -1 will use the value from configuration.": "Setting to -1 will use the value from configuration.",
     "IO": "IO",
     "Databases": "Databases",
-    "Database": "Database",
     "Backups": "Backups",
     "Allocations": "Allocations",
-    "Disabled": "Disabled",
-    "Submit": "Submit",
+    "Product Linking": "Product Linking",
+    "Link your products to nodes and eggs to create dynamic pricing for each option": "Link your products to nodes and eggs to create dynamic pricing for each option",
     "This product will only be available for these nodes": "This product will only be available for these nodes",
     "This product will only be available for these eggs": "This product will only be available for these eggs",
-    "Will hide this option from being selected": "Will hide this option from being selected",
-    "Link your products to nodes and eggs to create dynamic pricing for each option": "Link your products to nodes and eggs to create dynamic pricing for each option",
-    "Setting to -1 will use the value from configuration.": "Setting to -1 will use the value from configuration.",
-    "This is what the users sees": "This is what the users sees",
-    "Edit": "Edit",
-
-    "Price": "Price",
-    "Are you sure you wish to delete?": "Are you sure you wish to delete?",
-    "Create new": "Create new",
-    "Show": "Show",
+    "Product": "Product",
+    "CPU": "CPU",
     "Updated at": "Updated at",
+    "User": "User",
+    "Config": "Config",
     "Suspended at": "Suspended at",
-
     "Settings": "Settings",
     "Dashboard icons": "Dashboard icons",
+    "Invoice Settings": "Invoice Settings",
     "Select panel icon": "Select panel icon",
     "Select panel favicon": "Select panel favicon",
-
-    "Token": "Token",
-    "Last used": "Last used",
-
+    "Download all Invoices": "Download all Invoices",
+    "Enter your companys name": "Enter your companys name",
+    "Enter your companys address": "Enter your companys address",
+    "Enter your companys phone number": "Enter your companys phone number",
+    "Enter your companys VAT id": "Enter your companys VAT id",
+    "Enter your companys email address": "Enter your companys email address",
+    "Enter your companys website": "Enter your companys website",
+    "Enter your custom invoice prefix": "Enter your custom invoice prefix",
+    "Logo": "Logo",
+    "Select Invoice Logo": "Select Invoice Logo",
     "Store": "Store",
     "Currency code": "Currency code",
     "Checkout the paypal docs to select the appropriate code": "Checkout the paypal docs to select the appropriate code",
@@ -102,110 +172,97 @@
     "Amount given to the user after purchasing": "Amount given to the user after purchasing",
     "Display": "Display",
     "This is what the user sees at store and checkout": "This is what the user sees at store and checkout",
-    "This is what the user sees at checkout": "This is what the user sees at checkout",
     "Adds 1000 credits to your account": "Adds 1000 credits to your account",
-
-    "Active": "Active",
+    "This is what the user sees at checkout": "This is what the user sees at checkout",
     "No payment method is configured.": "No payment method is configured.",
     "To configure the payment methods, head to the .env and add the required options for your prefered payment method.": "To configure the payment methods, head to the .env and add the required options for your prefered payment method.",
-
     "Useful Links": "Useful Links",
     "Icon class name": "Icon class name",
     "You can find available free icons": "You can find available free icons",
     "Title": "Title",
     "Link": "Link",
-
+    "description": "description",
+    "Icon": "Icon",
     "Username": "Username",
     "Email": "Email",
-    "Pterodactly ID": "Pterodactly ID",
+    "Pterodactyl ID": "Pterodactyl ID",
+    "This ID refers to the user account created on pterodactyls panel.": "This ID refers to the user account created on pterodactyls panel.",
+    "Only edit this if you know what youre doing :)": "Only edit this if you know what youre doing :)",
     "Server Limit": "Server Limit",
     "Role": "Role",
-    "Administrator": "Administrator",
+    " Administrator": " Administrator",
     "Client": "Client",
     "Member": "Member",
     "New Password": "New Password",
     "Confirm Password": "Confirm Password",
-    "This ID refers to the user account created on pterodactyls panel.": "This ID refers to the user account created on pterodactyls panel.",
-    "Only edit this if you know what youre doing :)": "Only edit this if you know what youre doing :)",
-
+    "Notify": "Notify",
+    "Avatar": "Avatar",
     "Verified": "Verified",
     "Last seen": "Last seen",
-    "Notify": "Notify",
-
+    "Notifications": "Notifications",
     "All": "All",
     "Send via": "Send via",
+    "Database": "Database",
     "Content": "Content",
-    "Notifications": "Notifications",
-
+    "Server limit": "Server limit",
+    "Discord": "Discord",
     "Usage": "Usage",
-
-    "Config": "Config",
-
+    "IP": "IP",
     "Vouchers": "Vouchers",
     "Voucher details": "Voucher details",
-    "Memo": "Memo",
+    "Summer break voucher": "Summer break voucher",
     "Code": "Code",
+    "Random": "Random",
     "Uses": "Uses",
-    "Expires at": "Expires at",
+    "A voucher can only be used one time per user. Uses specifies the number of different users that can use this voucher.": "A voucher can only be used one time per user. Uses specifies the number of different users that can use this voucher.",
     "Max": "Max",
-    "Random": "Random",
-
-    "Status": "Status",
-    "Used / Uses": "Used / Uses",
+    "Expires at": "Expires at",
+    "Used \/ Uses": "Used \/ Uses",
     "Expires": "Expires",
-
-    "Please confirm your password before continuing.": "Please confirm your password before continuing.",
-    "Password": "Password",
-    "Forgot Your Password?": "Forgot Your Password?",
     "Sign in to start your session": "Sign in to start your session",
+    "Password": "Password",
     "Remember Me": "Remember Me",
     "Sign In": "Sign In",
+    "Forgot Your Password?": "Forgot Your Password?",
     "Register a new membership": "Register a new membership",
+    "Please confirm your password before continuing.": "Please confirm your password before continuing.",
     "You forgot your password? Here you can easily retrieve a new password.": "You forgot your password? Here you can easily retrieve a new password.",
     "Request new password": "Request new password",
     "Login": "Login",
     "You are only one step a way from your new password, recover your password now.": "You are only one step a way from your new password, recover your password now.",
     "Retype password": "Retype password",
     "Change password": "Change password",
-    "I already have a membership": "I already have a membership",
     "Register": "Register",
+    "I already have a membership": "I already have a membership",
     "Verify Your Email Address": "Verify Your Email Address",
     "A fresh verification link has been sent to your email address.": "A fresh verification link has been sent to your email address.",
     "Before proceeding, please check your email for a verification link.": "Before proceeding, please check your email for a verification link.",
     "If you did not receive the email": "If you did not receive the email",
     "click here to request another": "click here to request another",
-
+    "per month": "per month",
+    "Out of Credits in": "Out of Credits in",
     "Home": "Home",
-    "Languages": "Languages",
     "See all Notifications": "See all Notifications",
+    "Redeem code": "Redeem code",
     "Profile": "Profile",
     "Log back in": "Log back in",
     "Logout": "Logout",
     "Administration": "Administration",
     "Overview": "Overview",
-    "Application API": "Application API",
     "Management": "Management",
     "Other": "Other",
     "Logs": "Logs",
-    "Redeem code": "Redeem code",
-
+    "Warning!": "Warning!",
     "You have not yet verified your email address": "You have not yet verified your email address",
     "Click here to resend verification email": "Click here to resend verification email",
     "Please contact support If you didnt receive your verification email.": "Please contact support If you didnt receive your verification email.",
-
     "Thank you for your purchase!": "Thank you for your purchase!",
     "Your payment has been confirmed; Your credit balance has been updated.": "Your payment has been confirmed; Your credit balance has been updated.",
-
-    "Payment ID": "Payment ID",
-    "Balance": "Balance",
-    "User ID": "User ID",
     "Thanks": "Thanks",
-
     "Redeem voucher code": "Redeem voucher code",
+    "Close": "Close",
     "Redeem": "Redeem",
-
     "All notifications": "All notifications",
-
     "Required Email verification!": "Required Email verification!",
     "Required Discord verification!": "Required Discord verification!",
     "You have not yet verified your discord account": "You have not yet verified your discord account",
@@ -213,13 +270,14 @@
     "Please contact support If you face any issues.": "Please contact support If you face any issues.",
     "Due to system settings you are required to verify your discord account!": "Due to system settings you are required to verify your discord account!",
     "It looks like this hasnt been set-up correctly! Please contact support.": "It looks like this hasnt been set-up correctly! Please contact support.",
-
     "Change Password": "Change Password",
     "Current Password": "Current Password",
-    "Save Changes": "Save Changes",
-    "Re-Sync Discord": "Re-Sync Discord",
-    "You are verified!": "You are verified!",
+    "Link your discord account!": "Link your discord account!",
     "By verifying your discord account, you receive extra Credits and increased Server amounts": "By verifying your discord account, you receive extra Credits and increased Server amounts",
+    "Login with Discord": "Login with Discord",
+    "You are verified!": "You are verified!",
+    "Re-Sync Discord": "Re-Sync Discord",
+    "Save Changes": "Save Changes",
     "Server configuration": "Server configuration",
     "Error!": "Error!",
     "Make sure to link your products to nodes and eggs.": "Make sure to link your products to nodes and eggs.",
@@ -228,143 +286,64 @@
     "No nodes have been linked!": "No nodes have been linked!",
     "No nests available!": "No nests available!",
     "No eggs have been linked!": "No eggs have been linked!",
-    "Software / Games": "Software / Games",
+    "Software \/ Games": "Software \/ Games",
     "Please select software ...": "Please select software ...",
-    "Specification": "Specification",
-    "No selection": "No selection",
-    "per month": "per month",
-    "Not enough credits!": "Not enough credits!",
-    "Not enough" : "Not enough",
-    "Please select a configuration ...": "Please select a configuration ...",
-    "No resources found matching current configuration": "No resources found matching current configuration",
-    "No nodes found matching current configuration": "No nodes found matching current configuration",
-    "Please select a node ...": "Please select a node ...",
+    "---": "---",
+    "Specification ": "Specification ",
+    "Node": "Node",
+    "Resource Data:": "Resource Data:",
+    "MB": "MB",
+    "MySQL": "MySQL",
+    "ports": "ports",
+    "Not enough": "Not enough",
     "Create server": "Create server",
-    "Use your servers on our": "Use your servers on our",
-    "pterodactyl panel": "pterodactyl panel",
-    "Server limit reached!": "Server limit reached!",
+    "Please select a node ...": "Please select a node ...",
+    "No nodes found matching current configuration": "No nodes found matching current configuration",
+    "Please select a resource ...": "Please select a resource ...",
+    "No resources found matching current configuration": "No resources found matching current configuration",
+    "Please select a configuration ...": "Please select a configuration ...",
+    "Not enough credits!": "Not enough credits!",
     "Create Server": "Create Server",
+    "Software": "Software",
+    "Specification": "Specification",
+    "Resource plan": "Resource plan",
+    "per Hour": "per Hour",
+    "per Month": "per Month",
     "Manage": "Manage",
-    "Delete server": "Delete server",
-    "Price per Hour": "Price per Hour",
-    "Price per Month": "Price per Month",
-
+    "Are you sure?": "Are you sure?",
+    "This is an irreversible action, all files of this server will be removed.": "This is an irreversible action, all files of this server will be removed.",
+    "Yes, delete it!": "Yes, delete it!",
+    "No, cancel!": "No, cancel!",
+    "Canceled ...": "Canceled ...",
+    "Deletion has been canceled.": "Deletion has been canceled.",
     "Date": "Date",
     "To": "To",
     "From": "From",
     "Pending": "Pending",
     "Subtotal": "Subtotal",
-    "Submit Payment": "Submit Payment",
     "Payment Methods": "Payment Methods",
-    "Payment method": "Payment method",
-    "By purchasing this product you agree and accept our terms of service": "By purchasing this product you agree and accept our terms of service",
+    "Amount Due": "Amount Due",
+    "Tax": "Tax",
+    "Submit Payment": "Submit Payment",
+    "Purchase": "Purchase",
     "There are no store products!": "There are no store products!",
     "The store is not correctly configured!": "The store is not correctly configured!",
-    "Out of Credits in": "Out of Credits in",
-
-    "days": "days",
-    "hours": "hours",
-    "You ran out of Credits": "You ran out of Credits",
-
-    "Profile updated": "Profile updated",
-
-    "You are required to verify your email address before you can create a server.": "You are required to verify your email address before you can create a server.",
-    "You are required to link your discord account before you can create a server.": "You are required to link your discord account before you can create a server.",
-    "No allocations satisfying the requirements for automatic deployment on this node were found.": "No allocations satisfying the requirements for automatic deployment on this node were found.",
-    "Server removed": "Server removed",
-    "Server created": "Server created",
-    "An exception has occurred while trying to remove a resource \"": "An exception has occurred while trying to remove a resource \"",
-    "You are required to verify your email address before you can purchase credits.": "You are required to verify your email address before you can purchase credits.",
-    "You are required to link your discord account before you can purchase ": "You are required to link your discord account before you can purchase ",
-
-    "Warning!": "Warning!",
-
-    "api key created!": "api key created!",
-    "api key updated!": "api key updated!",
-    "api key has been removed!": "api key has been removed!",
-    "configuration has been updated!": "configuration has been updated!",
-    "Pterodactyl synced": "Pterodactyl synced",
-    "Your credit balance has been increased!": "Your credit balance has been increased!",
-    "Payment was Canceled": "Payment was Canceled",
-
-    "Store item has been created!": "Store item has been created!",
-    "Store item has been updated!": "Store item has been updated!",
-    "Product has been updated!": "Product has been updated!",
-    "Store item has been removed!": "Store item has been removed!",
-    "Product has been created!": "Product has been created!",
-    "Product has been removed!": "Product has been removed!",
-    "Server has been updated!": "Server has been updated!",
-    "Icons updated!": "Icons updated!",
-    "link has been created!": "link has been created!",
-    "link has been updated!": "link has been updated!",
-    "user has been removed!": "user has been removed!",
-    "Notification sent!": "Notification sent!",
-    "User has been updated!": "User has been updated!",
-    "User does not exists on pterodactyl's panel": "User does not exists on pterodactyl's panel",
-    "voucher has been created!": "voucher has been created!",
-    "voucher has been updated!": "voucher has been updated!",
-    "voucher has been removed!": "voucher has been removed!",
-    "This voucher has reached the maximum amount of uses": "This voucher has reached the maximum amount of uses",
-    "This voucher has expired": "This voucher has expired",
-    "You already redeemed this voucher code": "You already redeemed this voucher code",
-    "You can't redeem this voucher because you would exceed the  limit of ": "You can't redeem this voucher because you would exceed the  limit of ",
-    "have been added to your balance!": "have been added to your balance!",
-    "Invoice": "Invoice",
     "Serial No.": "Serial No.",
     "Invoice date": "Invoice date",
     "Seller": "Seller",
     "Buyer": "Buyer",
     "Address": "Address",
-    "VAT code": "VAT code",
+    "VAT Code": "VAT Code",
     "Phone": "Phone",
     "Units": "Units",
-    "Qty": "Qty",
     "Discount": "Discount",
-    "Sub total": "Sub total",
     "Total discount": "Total discount",
     "Taxable amount": "Taxable amount",
-    "Total taxes": "Total taxes",
     "Tax rate": "Tax rate",
+    "Total taxes": "Total taxes",
+    "Shipping": "Shipping",
     "Total amount": "Total amount",
-    "Please pay until": "Please pay until",
-    "Amount in words": "Amount in words",
     "Notes": "Notes",
-    "Shipping": "Shipping",
-    "Paid": "Paid",
-    "Due:": "Due:",
-    "Invoice Settings": "Invoice Settings",
-    "Download all Invoices": "Download all Invoices",
-    "Enter your companys name": "Enter your companys name",
-    "Enter your companys address": "Enter your companys address",
-    "Enter your companys phone number": "Enter your companys phone number",
-    "Enter your companys VAT id": "Enter your companys VAT id",
-    "Enter your companys email address": "Enter your companys email address",
-    "Enter your companys website": "Enter your companys website",
-    "Enter your custom invoice prefix": "Enter your custom invoice prefix",
-    "Select Invoice Logo": "Select Invoice Logo",
-
-    "Payment Confirmation": "Payment Confirmation",
-    "Payment Confirmed!": "Payment Confirmed!",
-    "Server Creation Error": "Server Creation Error",
-    "Your servers have been suspended!": "Your servers have been suspended!",
-    "To automatically re-enable your server/s, you need to purchase more credits.": "To automatically re-enable your server/s, you need to purchase more credits.",
-    "Purchase credits": "Purchase credits",
-    "If you have any questions please let us know.": "If you have any questions please let us know.",
-    "Regards": "Regards",
-
-    "Getting started!": "Getting started!",
-    "EXPIRED": "EXPIRED",
-    "VALID": "VALID",
-
-    "Unsuspend": "Unsuspend",
-    "Suspend": "Suspend",
-    "Delete": "Delete",
-    "Login as User": "Login as User",
-    "Clone": "Clone",
-
-    "Amount due": "Amount due",
-
-    "Your Payment was successful!": "Your Payment was successful!",
-    "Hello": "Hello",
-    "Your payment was processed successfully!": "Your payment was processed successfully!"
-}
+    "Amount in words": "Amount in words",
+    "Please pay until": "Please pay until"
+}

+ 4 - 5
resources/sass/app.scss

@@ -1,8 +1,7 @@
 // Fonts
-@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback');
+@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback");
 
 // Bootstrap
-@import '../css/stylesheet.css';
-@import '../css/adminlte.min.css';
-@import '../css/slim.min.css';
-
+@import "../css/stylesheet.css";
+@import "../css/adminlte.min.css";
+@import "../css/slim.min.css";

+ 162 - 73
resources/views/servers/index.blade.php

@@ -6,12 +6,13 @@
         <div class="container-fluid">
             <div class="row mb-2">
                 <div class="col-sm-6">
-                    <h1>{{__('Servers')}}</h1>
+                    <h1>{{ __('Servers') }}</h1>
                 </div>
                 <div class="col-sm-6">
                     <ol class="breadcrumb float-sm-right">
-                        <li class="breadcrumb-item"><a href="{{route('home')}}">{{__('Dashboard')}}</a></li>
-                        <li class="breadcrumb-item"><a class="text-muted" href="{{route('servers.index')}}">{{__('Servers')}}</a>
+                        <li class="breadcrumb-item"><a href="{{ route('home') }}">{{ __('Dashboard') }}</a></li>
+                        <li class="breadcrumb-item"><a class="text-muted"
+                                href="{{ route('servers.index') }}">{{ __('Servers') }}</a>
                         </li>
                     </ol>
                 </div>
@@ -25,96 +26,184 @@
         <div class="container-fluid">
 
             <!-- CUSTOM CONTENT -->
-            <div class="d-flex justify-content-between mb-3">
-                <p>{{__('Use your servers on our')}} <a href="{{env('PTERODACTYL_URL' , 'http://localhost')}}">{{__('pterodactyl panel')}}</a></p>
-                <a @if(Auth::user()->Servers->count() >= Auth::user()->server_limit) disabled="disabled" title="{{__('Server limit reached!')}}" @endif href="{{route('servers.create')}}" class="btn @if(Auth::user()->Servers->count() >= Auth::user()->server_limit) disabled @endif btn-primary"><i class="fa fa-plus mr-2"></i>{{__('Create Server')}}</a>
+            <div class="d-flex justify-content-md-start justify-content-center mb-3 ">
+                <a @if (Auth::user()->Servers->count() >= Auth::user()->server_limit)
+                    disabled="disabled" title="Server limit reached!"
+                    @endif href="{{ route('servers.create') }}"
+                    class="btn
+                    @if (Auth::user()->Servers->count() >= Auth::user()->server_limit) disabled
+                    @endif btn-primary"><i
+                        class="fa fa-plus mr-2"></i>
+                    {{ __('Create Server') }}
+                </a>
             </div>
 
-            <div class="row">
-                @foreach($servers as $server)
-                    <div class="col-lg-4">
-                        <div class="card">
-                            <div class="card-header ">
-                                <div class="d-flex justify-content-between">
-                                    <h5 class="card-title"><i class="fas {{$server->isSuspended() ? 'text-danger' : 'text-success'}} fa-circle mr-2"></i>{{$server->name}}</h5>
-                                    <div class="card-tools">
-                                        <div class="dropdown no-arrow">
-                                            <a  href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-                                                <i class="fas fa-ellipsis-v fa-sm fa-fw text-white-50"></i>
-                                            </a>
-                                            <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
-                                                <a href="{{env('PTERODACTYL_URL' , 'http://localhost')}}/server/{{$server->identifier}}"  target="__blank" class="dropdown-item text-info"><i title="manage" class="fas fa-tasks mr-2"></i><span>{{__('Manage')}}</span></a>
-                                                @if(!empty(env('PHPMYADMIN_URL')))
-                                                    <a href="{{env('PHPMYADMIN_URL' , 'http://localhost')}}" class="dropdown-item text-info"  target="__blank"><i title="manage" class="fas fa-database mr-2"></i><span>{{__('Database')}}</span></a>
-                                                @endif
-                                                <form method="post" onsubmit="return submitResult();" action="{{route('servers.destroy' , $server->id)}}">
-                                                    @csrf
-                                                    @method('DELETE')
-                                                    <button class="dropdown-item text-danger"><i title="delete" class="fas fa-trash mr-2"></i><span>{{__('Delete server')}}</span></button>
-                                                </form>
-                                                <div class="dropdown-divider"></div>
-                                                <span class="dropdown-item"><i title="Created at" class="fas fa-sync-alt mr-2"></i><span>{{$server->created_at->isoFormat('LL')}}</span></span>
-                                            </div>
+            <div class="row d-flex flex-row justify-content-center justify-content-md-start">
+                @foreach ($servers as $server)
+
+                    <div class="col-xl-3 col-lg-5 col-md-6 col-sm-6 col-xs-12 card pr-0 pl-0 ml-sm-2 mr-sm-3"
+                        style="max-width: 350px">
+                        <div class="card-header">
+                            <div class="d-flex justify-content-between align-items-center">
+                                <h5 class="card-title mt-1">{{ $server->name }}
+                                </h5>
+                                <div class="card-tools mt-1">
+                                    <div class="dropdown no-arrow">
+                                        <a href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown"
+                                            aria-haspopup="true" aria-expanded="false">
+                                            <i class="fas fa-ellipsis-v fa-sm fa-fw text-white-50"></i>
+                                        </a>
+                                        <div class="dropdown-menu dropdown-menu-right shadow animated--fade-in"
+                                            aria-labelledby="dropdownMenuLink">
+                                            @if (!empty(env('PHPMYADMIN_URL')))
+                                                <a href="{{ env('PHPMYADMIN_URL', 'http://localhost') }}"
+                                                    class="dropdown-item text-info" target="__blank"><i title="manage"
+                                                        class="fas fa-database mr-2"></i><span>{{ __('Database') }}</span></a>
+                                            @endif
+                                            <div class="dropdown-divider"></div>
+                                            <span class="dropdown-item"><i title="Created at"
+                                                    class="fas fa-sync-alt mr-2"></i><span>{{ $server->created_at->isoFormat('LL') }}</span></span>
                                         </div>
                                     </div>
                                 </div>
                             </div>
-                            <div class="card-body">
-                                <span class="text-muted">{{__('Server Details')}}</span>
-                                <table class="table">
-                                    <tr>
-                                        <td>{{__('Cpu')}}</td>
-                                        <td>{{$server->product->cpu}} %</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{{__('Memory')}}</td>
-                                        <td>{{$server->product->memory}} MB</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{{__('Disk')}}</td>
-                                        <td>{{$server->product->disk}} MB</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{{__('Databases')}}</td>
-                                        <td>{{$server->product->databases}} MySQL</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{{__('Backups')}}</td>
-                                        <td>{{$server->product->backups}}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{{__('Price per Hour')}}</td>
-                                        <td>{{number_format($server->product->getHourlyPrice(),2,".", "")}} {{CREDITS_DISPLAY_NAME}}</td>
-                                    </tr>
-                                    <tr>
-                                        <td>{{__('Price per Month')}}</td>
-                                        <td>{{$server->product->getHourlyPrice()*24*30}} {{CREDITS_DISPLAY_NAME}}</td>
-                                    </tr>
-                                </table>
-                            </div>
+                        </div>
+                        <div class="card-body">
+                            <div class="container mt-1">
+                                <div class="row mb-3">
+                                    <div class="col my-auto">{{ __('Status') }}:</div>
+                                    <div class="col-7 my-auto">
+                                        <i
+                                            class="fas {{ $server->isSuspended() ? 'text-danger' : 'text-success' }} fa-circle mr-2"></i>
+                                        {{ $server->isSuspended() ? 'Suspended' : 'Active' }}
+                                    </div>
+                                </div>
+                                <div class="row mb-2">
+                                    <div class="col-5">
+                                        {{ __('Location') }}:
+                                    </div>
+                                    <div class="col-7 d-flex justify-content-between align-items-center">
+                                        <span class="">{{ $server->location }}</span>
+                                        <i data-toggle="popover" data-trigger="hover"
+                                            data-content="{{ __('Node') }}: {{ $server->node }}"
+                                            class="fas fa-info-circle"></i>
+                                    </div>
 
+                                </div>
+                                <div class="row mb-2">
+                                    <div class="col-5 ">
+                                        {{ __('Software') }}:
+                                    </div>
+                                    <div class="col-7 text-wrap">
+                                        <span>{{ $server->nest }}</span>
+                                    </div>
 
-                            <div class="card-footer d-flex justify-content-between">
-                                <a href="{{env('PTERODACTYL_URL' , 'http://localhost')}}/server/{{$server->identifier}}"  target="__blank" class="btn btn-info mx-3 w-100"><i class="fas fa-tasks mr-2"></i>{{__('Manage')}}</a>
-                                @if(!empty(env('PHPMYADMIN_URL')))
-                                    <a href="{{env('PHPMYADMIN_URL' , 'http://localhost')}}" target="__blank" class="btn btn-info mx-3 w-100" ><i class="fas fa-database mr-2"></i>{{__('Database')}}</a>
-                                @endif
+                                </div>
+                                <div class="row mb-2">
+                                    <div class="col-5 ">
+                                        {{ __('Specification') }}:
+                                    </div>
+                                    <div class="col-7 text-wrap">
+                                        <span>{{ $server->egg }}</span>
+                                    </div>
+                                </div>
+                                <div class="row mb-4">
+                                    <div class="col-5 ">
+                                        {{ __('Resource plan') }}:
+                                    </div>
+                                    <div class="col-7 text-wrap d-flex justify-content-between align-items-center">
+                                        <span>{{ $server->product->name }}
+                                        </span>
+                                        <i data-toggle="popover" data-trigger="hover" data-html="true"
+                                            data-content="{{ __('CPU') }}: {{ $server->product->cpu / 100 }} {{ __('vCores') }} <br/>{{ __('RAM') }}: {{ $server->product->memory }} MB <br/>{{ __('Disk') }}: {{ $server->product->disk }} MB <br/>{{ __('Backups') }}: {{ $server->product->backups }} <br/> {{ __('MySQL Databases') }}: {{ $server->product->databases }} <br/> {{ __('Allocations') }}: {{ $server->product->allocations }} <br/>"
+                                            class="fas fa-info-circle"></i>
+                                    </div>
+
+                                </div>
+                                <div class="row mb-2">
+                                    <div class="col-4">
+                                        {{ __('Price') }}:
+                                        <span class="text-muted">
+                                            ({{ CREDITS_DISPLAY_NAME }})
+                                        </span>
+                                    </div>
+                                    <div class="col-8">
+                                        <div class="row">
+                                            <div class="col-6  text-center">
+                                                <div class="text-muted">{{ __('per Hour') }}</div>
+                                                <span>
+                                                    {{ number_format($server->product->getHourlyPrice(), 2, '.', '') }}
+                                                </span>
+                                            </div>
+                                            <div class="col-6  text-center">
+                                                <div class="text-muted">{{ __('per Month') }}
+                                                </div>
+                                                <span>
+                                                    {{ $server->product->getHourlyPrice() * 24 * 30 }}
+                                                </span>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
                             </div>
+                        </div>
 
+                        <div class="card-footer d-flex align-items-center justify-content-between">
+                            <a href="{{ env('PTERODACTYL_URL', 'http://localhost') }}/server/{{ $server->identifier }}"
+                                target="__blank"
+                                class="btn btn-info mx-3 w-100 align-items-center justify-content-center d-flex">
+                                <i class="fas fa-tools mr-2"></i>
+                                <span>{{ __('Manage') }}</span>
+                            </a>
+                            <button onclick="confirmSubmit('{{ $server->id }}', handleServerDelete);" target="__blank"
+                                class="btn btn-danger mx-3 w-100 align-items-center justify-content-center d-flex">
+                                <i class="fas fa-trash mr-2"></i>
+                                <span>{{ __('Delete') }}</span>
+                            </button>
                         </div>
                     </div>
                 @endforeach
             </div>
             <!-- END CUSTOM CONTENT -->
-
-
         </div>
     </section>
     <!-- END CONTENT -->
 
     <script>
-        function submitResult() {
-            return confirm("{{__('Are you sure you wish to delete?')}}") !== false;
+        const confirmSubmit = (serverId, handleServerDelete) => {
+            // Confirm delete submit with sweetalert
+            Swal.fire({
+                title: "{{ __('Are you sure?') }}",
+                text: "{{ __('This is an irreversible action, all files of this server will be removed.') }}",
+                icon: 'warning',
+                confirmButtonColor: '#d9534f',
+                showCancelButton: true,
+                confirmButtonText: "{{ __('Yes, delete it!') }}",
+                cancelButtonText: "{{ __('No, cancel!') }}",
+                reverseButtons: true
+            }).then((result) => {
+                if (result.value) {
+                    handleServerDelete(serverId);
+                    return
+                }
+                Swal.fire("{{ __('Canceled ...') }}", `{{ __('Deletion has been canceled.') }}`, 'info');
+            });
         }
+
+        const handleServerDelete = (serverId) => {
+            // Delete server
+            fetch("{{ route('servers.destroy', '') }}" + '/' + serverId, {
+                method: 'DELETE',
+                headers: {
+                    'X-CSRF-TOKEN': '{{ csrf_token() }}'
+                }
+            }).then(() => {
+                window.location.reload();
+            });
+        }
+
+        document.addEventListener('DOMContentLoaded', () => {
+            $('[data-toggle="popover"]').popover();
+        });
     </script>
 @endsection

+ 3 - 3
resources/views/vendor/invoices/templates/controlpanel.blade.php

@@ -364,15 +364,15 @@
 
         @if($invoice->notes)
             <p>
-                {{ trans('Notes') }}:<br/> {!! $invoice->notes !!}
+                {{ __('Notes') }}: {!! $invoice->notes !!}
             </p>
         @endif
 
         <p>
-            {{ trans('Amount in words') }}: {{ $invoice->getTotalAmountInWords() }}
+            {{ __('Amount in words') }}: {{ $invoice->getTotalAmountInWords() }}
         </p>
         <p>
-            {{ trans('Please pay until') }}: {{ $invoice->getPayUntilDate() }}
+            {{ __('Please pay until') }}: {{ $invoice->getPayUntilDate() }}
         </p>
 
         <script type="text/php">

+ 25 - 25
resources/views/vendor/invoices/templates/default.blade.php

@@ -152,8 +152,8 @@
                                 <strong>{{ $invoice->status }}</strong>
                             </h4>
                         @endif
-                        <p>{{ __('invoices::invoice.serial') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p>
-                        <p>{{ __('invoices::invoice.date') }}: <strong>{{ $invoice->getDate() }}</strong></p>
+                        <p>{{ trans('invoices::invoice.serial') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p>
+                        <p>{{ trans('invoices::invoice.date') }}: <strong>{{ $invoice->getDate() }}</strong></p>
                     </td>
                 </tr>
             </tbody>
@@ -164,11 +164,11 @@
             <thead>
                 <tr>
                     <th class="border-0 pl-0 party-header" width="48.5%">
-                        {{ __('invoices::invoice.seller') }}
+                        {{ trans('invoices::invoice.seller') }}
                     </th>
                     <th class="border-0" width="3%"></th>
                     <th class="border-0 pl-0 party-header">
-                        {{ __('invoices::invoice.buyer') }}
+                        {{ trans('invoices::invoice.buyer') }}
                     </th>
                 </tr>
             </thead>
@@ -183,25 +183,25 @@
 
                         @if($invoice->seller->address)
                             <p class="seller-address">
-                                {{ __('invoices::invoice.address') }}: {{ $invoice->seller->address }}
+                                {{ trans('invoices::invoice.address') }}: {{ $invoice->seller->address }}
                             </p>
                         @endif
 
                         @if($invoice->seller->code)
                             <p class="seller-code">
-                                {{ __('invoices::invoice.code') }}: {{ $invoice->seller->code }}
+                                {{ trans('invoices::invoice.code') }}: {{ $invoice->seller->code }}
                             </p>
                         @endif
 
                         @if($invoice->seller->vat)
                             <p class="seller-vat">
-                                {{ __('invoices::invoice.vat') }}: {{ $invoice->seller->vat }}
+                                {{ trans('invoices::invoice.vat') }}: {{ $invoice->seller->vat }}
                             </p>
                         @endif
 
                         @if($invoice->seller->phone)
                             <p class="seller-phone">
-                                {{ __('invoices::invoice.phone') }}: {{ $invoice->seller->phone }}
+                                {{ trans('invoices::invoice.phone') }}: {{ $invoice->seller->phone }}
                             </p>
                         @endif
 
@@ -221,25 +221,25 @@
 
                         @if($invoice->buyer->address)
                             <p class="buyer-address">
-                                {{ __('invoices::invoice.address') }}: {{ $invoice->buyer->address }}
+                                {{ trans('invoices::invoice.address') }}: {{ $invoice->buyer->address }}
                             </p>
                         @endif
 
                         @if($invoice->buyer->code)
                             <p class="buyer-code">
-                                {{ __('invoices::invoice.code') }}: {{ $invoice->buyer->code }}
+                                {{ trans('invoices::invoice.code') }}: {{ $invoice->buyer->code }}
                             </p>
                         @endif
 
                         @if($invoice->buyer->vat)
                             <p class="buyer-vat">
-                                {{ __('invoices::invoice.vat') }}: {{ $invoice->buyer->vat }}
+                                {{ trans('invoices::invoice.vat') }}: {{ $invoice->buyer->vat }}
                             </p>
                         @endif
 
                         @if($invoice->buyer->phone)
                             <p class="buyer-phone">
-                                {{ __('invoices::invoice.phone') }}: {{ $invoice->buyer->phone }}
+                                {{ trans('invoices::invoice.phone') }}: {{ $invoice->buyer->phone }}
                             </p>
                         @endif
 
@@ -257,19 +257,19 @@
         <table class="table table-items">
             <thead>
                 <tr>
-                    <th scope="col" class="border-0 pl-0">{{ __('invoices::invoice.description') }}</th>
+                    <th scope="col" class="border-0 pl-0">{{ trans('invoices::invoice.description') }}</th>
                     @if($invoice->hasItemUnits)
-                        <th scope="col" class="text-center border-0">{{ __('invoices::invoice.units') }}</th>
+                        <th scope="col" class="text-center border-0">{{ trans('invoices::invoice.units') }}</th>
                     @endif
-                    <th scope="col" class="text-center border-0">{{ __('invoices::invoice.quantity') }}</th>
-                    <th scope="col" class="text-right border-0">{{ __('invoices::invoice.price') }}</th>
+                    <th scope="col" class="text-center border-0">{{ trans('invoices::invoice.quantity') }}</th>
+                    <th scope="col" class="text-right border-0">{{ trans('invoices::invoice.price') }}</th>
                     @if($invoice->hasItemDiscount)
-                        <th scope="col" class="text-right border-0">{{ __('invoices::invoice.discount') }}</th>
+                        <th scope="col" class="text-right border-0">{{ trans('invoices::invoice.discount') }}</th>
                     @endif
                     @if($invoice->hasItemTax)
-                        <th scope="col" class="text-right border-0">{{ __('invoices::invoice.tax') }}</th>
+                        <th scope="col" class="text-right border-0">{{ trans('invoices::invoice.tax') }}</th>
                     @endif
-                    <th scope="col" class="text-right border-0 pr-0">{{ __('invoices::invoice.sub_total') }}</th>
+                    <th scope="col" class="text-right border-0 pr-0">{{ trans('invoices::invoice.sub_total') }}</th>
                 </tr>
             </thead>
             <tbody>
@@ -310,7 +310,7 @@
                 @if($invoice->hasItemOrInvoiceDiscount())
                     <tr>
                         <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
-                        <td class="text-right pl-0">{{ __('invoices::invoice.total_discount') }}</td>
+                        <td class="text-right pl-0">{{ trans('invoices::invoice.total_discount') }}</td>
                         <td class="text-right pr-0">
                             {{ $invoice->formatCurrency($invoice->total_discount) }}
                         </td>
@@ -319,7 +319,7 @@
                 @if($invoice->taxable_amount)
                     <tr>
                         <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
-                        <td class="text-right pl-0">{{ __('invoices::invoice.taxable_amount') }}</td>
+                        <td class="text-right pl-0">{{ trans('invoices::invoice.taxable_amount') }}</td>
                         <td class="text-right pr-0">
                             {{ $invoice->formatCurrency($invoice->taxable_amount) }}
                         </td>
@@ -328,7 +328,7 @@
                 @if($invoice->tax_rate)
                     <tr>
                         <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
-                        <td class="text-right pl-0">{{ __('invoices::invoice.tax_rate') }}</td>
+                        <td class="text-right pl-0">{{ trans('invoices::invoice.tax_rate') }}</td>
                         <td class="text-right pr-0">
                             {{ $invoice->tax_rate }}%
                         </td>
@@ -337,7 +337,7 @@
                 @if($invoice->hasItemOrInvoiceTax())
                     <tr>
                         <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
-                        <td class="text-right pl-0">{{ __('invoices::invoice.total_taxes') }}</td>
+                        <td class="text-right pl-0">{{ trans('invoices::invoice.total_taxes') }}</td>
                         <td class="text-right pr-0">
                             {{ $invoice->formatCurrency($invoice->total_taxes) }}
                         </td>
@@ -346,7 +346,7 @@
                 @if($invoice->shipping_amount)
                     <tr>
                         <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
-                        <td class="text-right pl-0">{{ __('invoices::invoice.shipping') }}</td>
+                        <td class="text-right pl-0">{{ trans('invoices::invoice.shipping') }}</td>
                         <td class="text-right pr-0">
                             {{ $invoice->formatCurrency($invoice->shipping_amount) }}
                         </td>
@@ -354,7 +354,7 @@
                 @endif
                     <tr>
                         <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
-                        <td class="text-right pl-0">{{ __('invoices::invoice.total_amount') }}</td>
+                        <td class="text-right pl-0">{{ trans('invoices::invoice.total_amount') }}</td>
                         <td class="text-right pr-0 total-amount">
                             {{ $invoice->formatCurrency($invoice->total_amount) }}
                         </td>