1. Go to this page and download the library: Download mirmuxsin/laravel-midtrans 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 Sawirricardo\Midtrans\Laravel\Facades\Midtrans;
$transactionToken = Midtrans::client()->snap()->create(new TransactionDto());
echo $transactionToken->token;
echo $transactionToken->redirect_url;
//checkout.blade.php
// if you use Snap, you can