The essential news about content management systems and mobile technology. Powered by Perfect Publisher and XT Search for Algolia.
The News Site publishes posts to the following channels: Facebook, Instagram, Twitter, Telegram, Web Push, Tumblr, and Blogger.
Laravel Wallet is designed for reliable and flexible transactions and handles the complex part of storing transactions in the database for precise calculations. It provides an intuitive API that is easy to use and straightforward to understand.
Once you have followed the setup instructions, you can set up
the user model with the HasBalance
trait:
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use O21\LaravelWallet\Contracts\Payable;
use O21\LaravelWallet\Models\Concerns\HasBalance;
class User extends Model implements Payable
{
use HasBalance;
}
Here are some possible commands you can use to work with a
balance on the model. In the following examples, the
$sender
and $recipient
implement the
Payable
interface via the HasBalance
trait:
// Transfer money between sender and recipient
transfer(100, 'USD')->from($sender)->to($recipient)->commit();
// Deposit money into a recipient's account
deposit(100, 'USD')->to($recipient)->overcharge()->commit();
// Charge a user
charge(100, 'USD')->from($sender)->commit();
This package has resulted from the author using it privately on projects, honing it, and now releasing it as open-source. It includes safeguards for balance accuracy and a sophisticated rollback mechanism designed to revert modifications.
To get started with this package, check out the Laravel Wallet documentation—this package is open source and available on GitHub. The documentation also includes a Withdrawal example to demonstrate best practices with this package.
The post Handle Money Transactions in Eloquent with Laravel Wallet appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/wallet
Joomla! 5 is there and it brings a lot of improvements. One of them is the “Behaviour - Backward Compatibility” plugin. It’s not a feature you can see in backend or frontend, so what is the purpose of this plugin? Let’s answer the most important questions!
I discovered Joomla in 2008 when a web developer recommended I use it to replace a static HTML website I'd built for my not-for-profit dog training club. "Joomla's super easy to use," he enthused, adding, "after the initial 'WHAT THE!?' shock."
Read more https://magazine.joomla.org/all-issues/february-2024/smoothest-joomla-upgrade
Wherever you will travel for holidays, for business, or for any
other reason, there's probably a Joomla volunteer around.
Recently, I've been in Sweden and I've took this opportunity to
meet Sarah Watz, a famous Joomla volunteer but also a well-known
former OSM President.
Read more https://magazine.joomla.org/all-issues/february-2024/i-ve-meet-a-joomler-in-stockholm
If your software is free for everyone to use, does that mean it isn’t worth anything? Surely not! Three researchers from Harvard Business School and the University of Toronto have found a way to estimate the value of Open Source Software. Spoiler alert: it’s nowhere near nothing.
Read more https://magazine.joomla.org/all-issues/february-2024/the-value-of-open-source-software
Page 21 of 1310