laravel-money | Currency formatting and conversion package for Laravel

 by   akaunting PHP Version: 4.0.1 License: MIT

kandi X-RAY | laravel-money Summary

kandi X-RAY | laravel-money Summary

laravel-money is a PHP library typically used in Utilities applications. laravel-money has no vulnerabilities, it has a Permissive License and it has low support. However laravel-money has 2 bugs. You can download it from GitHub.

Currency formatting and conversion package for Laravel
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              laravel-money has a low active ecosystem.
              It has 547 star(s) with 76 fork(s). There are 17 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 5 open issues and 34 have been closed. On average issues are closed in 71 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of laravel-money is 4.0.1

            kandi-Quality Quality

              laravel-money has 2 bugs (0 blocker, 0 critical, 2 major, 0 minor) and 12 code smells.

            kandi-Security Security

              laravel-money has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              laravel-money code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              laravel-money is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              laravel-money releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 2569 lines of code, 123 functions and 13 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed laravel-money and discovered the below as its top functions. This is intended to give you an instant insight into laravel-money implemented functionality, and help decide if they suit your requirements.
            • Parse amount from string
            • Register the package services .
            • Allocate the money according to a list of ratios .
            • Adds an amount to this object
            • Parse an amount .
            • Returns an array representation of this object .
            • Get the currencies .
            • Returns the symbol .
            • Get the suffix
            • Register money .
            Get all kandi verified functions for this library.

            laravel-money Key Features

            No Key Features are available at this moment for laravel-money.

            laravel-money Examples and Code Snippets

            No Code Snippets are available at this moment for laravel-money.

            Community Discussions

            QUESTION

            Is There a Way to Import PHP Classes into a Blade Template and Use Them in Child Templates?
            Asked 2019-Jan-27 at 22:55

            I want to use the cknow/laravel-money package in pretty much every page in my app. I thought a tidy way to do this would be to import the class in the parent blade. However, child templates do not seem to have access to the imported class.

            I've tried using standard tags and @php @endphp directives.

            app.blade.php

            ...

            ANSWER

            Answered 2019-Jan-27 at 22:42

            You can write it using full path from child template.

            Source https://stackoverflow.com/questions/54393490

            QUESTION

            Money PHP - Loseless way to Persist Money Object in Database
            Asked 2018-Feb-09 at 12:19

            Am refering to moneyphp/money library which I plan to use it in one of our projects for dealing with currencies. The Documentation is great except it does not touch how to persist in the database. It speaks about encoding money object to JSON but storing strings makes it difficult to make queries as simple as comparing the amount or currencies.

            Going through issues, I have found few discussion about Doctrine and it is so specific to doctrine that I could not benefit anything.

            Asking my question, in concise words: How do I store money object without loosing details? I'm interested in Postgresql but any relational database is OK.

            Note: I have read many different way to persist monetary in database and they differ in how they do. Am interested in specific way that works with this specific library.

            ...

            ANSWER

            Answered 2018-Feb-09 at 12:19

            After tiresome reading of many different threads, posts et al, I have come to the conclusion that only two way are acceptable (see great comments in this question):

            1. Convert all money to smallest unit (eg. Cents) each time you save to the database and reconvert when retrieving it.

            2. Use DECIMAL/NUMERIC data type with needed accuracy (Many recommend NUMERIC(15,4) when doing normal operations or NUMERIC(15, 6) if you do currency exchange operations)

            Of course whatever the choice, it must be coupled with Currency column.

            I have ended up with the first method because of this library (which is not the original when I asked the question), which makes that super easy. Here are explanations from author after I created an issue:

            I can only tell you that I personally store my monies in the database as an integer representing the amount in minor units (cents), and optionally a CHAR(3) for the currency if the application uses multiple currencies (otherwise the currency is hardcoded in the app).

            You can get the amount in minor units this way, as an integer:

            $money->getMinorAmount()->toInt();

            And you can retrieve a Money from an integer stored in the database using:

            Money::ofMinor($integerAmount, 'USD');

            Source https://stackoverflow.com/questions/48661170

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install laravel-money

            Run the following command:.

            Support

            Pull requests are more than welcome. You must follow the PSR coding standards.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/akaunting/laravel-money.git

          • CLI

            gh repo clone akaunting/laravel-money

          • sshUrl

            git@github.com:akaunting/laravel-money.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular PHP Libraries

            laravel

            by laravel

            SecLists

            by danielmiessler

            framework

            by laravel

            symfony

            by symfony

            Try Top Libraries by akaunting

            akaunting

            by akauntingPHP

            laravel-firewall

            by akauntingPHP

            firewall

            by akauntingPHP

            laravel-setting

            by akauntingPHP

            setting

            by akauntingPHP