1. Go to this page and download the library: Download hassansin/dbcart library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Hassansin\DBCart\Models\Cart;
// get carts based on their status: active/expired/pending/complete
$active_carts = Cart::active()->get();
$expired_carts = Cart::expired()->get();
$pending_carts = Cart::pending()->get();
$completed_carts = Cart::completed()->get();
namespace App;
use Hassansin\DBCart\Models\Cart as BaseCart;
class Cart extends BaseCart
{
//override or add your methods here ...
public function getSubTotalAttribute(){
return $this->attributes['total_price'];
}
public function getGrandTotalAttribute(){
//taking discount, tax etc. into account
return $this->sub_total - $this->discount;
}
}
'cart_model' => App\Cart::class,
$cart = App::make('cart');
sh
php artisan vendor:publish --provider="Hassansin\DBCart\CartServiceProvider" --tag=migrations
php artisan migrate
sh
php artisan vendor:publish --provider="Hassansin\DBCart\CartServiceProvider" --tag=config
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.