1. Go to this page and download the library: Download soap/laravel-omise 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/ */
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Soap\LaravelOmise\Omise;
use Soap\LaravelOmise\Omise\Charge;
use Soap\LaravelOmise\Omise\Error;
class PaymentController extends Controller
{
public function __construct(protected Omise $omise) {}
public function create()
{
$publicKey = $this->omise->getPublicKey();
return view('payments.form', compact('publicKey'));
}
}