Laravel - Billable is a project to can accept a variety of payments methods and based on currency
If u have some recommendations, please do.
- Author: MCris112
- Vendor: mcris112
- Package: laravel-billable
- Version:
1.x
- PHP Version: 8.1+
- Laravel Version:
10.x
- MercadoPago
- Paypal
Install the package with the command Composer:
composer require mcris112/laravel-billable
//Return the Order cached and ready to use
$order = Order::get('9b3731fd-290d-4fbd-ab99-3d675080c37f');
// This can use it to set as api response
$order->toResource();
Order::class
is a Model from laravel but with some additional functions, and It's used for creating Orders or use it into payment processing
This static method is called when u want to retrieve the Order
$order = Order::get('9b3731fd-290d-4fbd-ab99-3d675080c37f');
Why do I have to use Order::get($id)
instead of Order::whereId($id)->get()
if It's a laravel model class?
Internally this method uses whereId()
but this is returned as cached from DB
/**
* Return the Order cached forever
* @param string $id
* @return self
* @throws OrderNotFoundException
*/
public static function get(string $id): self
{
...
}