PHP code example of ctf0 / laravel-paymob

1. Go to this page and download the library: Download ctf0/laravel-paymob 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/ */

    

ctf0 / laravel-paymob example snippets


    Route::group([
        'prefix'     => 'orders',
        'as'         => 'order.',
        'middleware' => 'auth',
    ], function () {
        ctf0\PayMob\PayMobRoutes::routes();
    });
    

    use Illuminate\Database\Eloquent\Model;
    use ctf0\PayMob\Integrations\Contracts\Billable;

    class Client extends Model implements Billable
    {
        // ...

        public function getBillingData(): array
        {
            return [
                'email'        => $this->email,
                'first_name'   => $this->first_name,
                'last_name'    => $this->last_name,
                'street'       => $this->address,
                'phone_number' => $this->phone_number,
            ];
        }
    }
    

    PayMob::refund(655, 10);
    
shell
    php artisan vendor:publish --provider="ctf0\PayMob\PayMobServiceProvider"