PHP code example of webreinvent / vaahextend
1. Go to this page and download the library: Download webreinvent/vaahextend 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/ */
webreinvent / vaahextend example snippets
'providers' => [
...
WebReinvent\VaahExtend\VaahExtendServiceProvider::class,
...
]
'aliases' => [
...
'VaahArtisan' => \WebReinvent\VaahExtend\Facades\VaahArtisan::class,
...
]
\VaahArtisan::migrate($command, $path, $db_connection_name );
\VaahArtisan::seed($command, $class, $db_connection_nane);
'aliases' => [
...
'VaahCountry' => \WebReinvent\VaahExtend\Facades\VaahCountry::class,
...
]
\VaahCountry::getByCode($country_code);
\VaahCountry::getByName($country_name);
\VaahCountry::getByCallingCode($calling_code);
\VaahCountry::getListSelectOptions($show='country_name');
\VaahCountry::getList();
\VaahCountry::getListWithSlug();
\VaahCountry::getListWithSlugAsCallingCode();
\VaahCountry::getTimeZones();
'aliases' => [
...
'VaahModule' => \WebReinvent\VaahExtend\Facades\VaahModule::class,
...
]
\VaahModule::getVaahCmsPath();
\VaahModule::getRootPath($module_name);
\VaahModule::getRelativePath($module_name);
\VaahModule::getAllPaths();
\VaahModule::getAllNames();
\VaahModule::getConfigs($module_name);
\VaahModule::getConfig($module_name, $key);
\VaahModule::getVersion($module_name);
\VaahModule::getVersionNumber($module_name);
\VaahModule::getAssetsUrl($module_name, $file_path);
\VaahModule::getMigrationPath($module_name);
\VaahModule::getSeedsClass($module_name);
\VaahModule::getTenantMigrationPath($module_name);
\VaahModule::getTenantSeedsClass($module_name);
\VaahModule::getTenantSampleData($module_name);
\VaahModule::getNamespace($module_name);
\VaahModule::getServiceProvider($module_name);
'aliases' => [
...
'VaahEventBrite' => WebReinvent\VaahExtend\Facades\VaahEventBrite::class,
...
]
\VaahEventBrite::events()->get();
$event_id = 12345;
\VaahEventBrite::events()->find($event_id);
$event = [
'name'=>'Event Name',
'description'=>'Event description',
....
...
];
\VaahEventBrite::events()->store($event);
\VaahEventBrite::events()->update($event_id, $event);
\VaahEventBrite::events()->cancel($event_id);
\VaahEventBrite::events()->publish($event_id);
\VaahEventBrite::events()->delete($event_id);
\VaahEventBrite::attendees()->get($event_id);
\VaahEventBrite::attendees()->find($event_id, $attendee_id);
\VaahEventBrite::orders()->find($order_id);
\VaahEventBrite::organizations()->get();
'aliases' => [
...
'VaahStripe' => WebReinvent\VaahExtend\Facades\VaahStripe::class,
...
]
$customer => [
'name' => 'xxxxxx',
'email' => '[email protected] '
];
$card => [
'number' => 'xxxx-xxxx-xxxx-xxxx',
'exp_month' => '01', // 01-12
'exp_year' => '2021',
'cvc' => 'xxx'
];
$address => [
'city' => 'xxxxxx', // optional
'country' => 'xxxxxx',
'line1' => 'xxxxxx',
'line2' => 'xxxxxx', // optional
'postal_code' => '123456', // optional
'state' => 'xxxxxx' // optional
];
$price_id // Price define the unit cost, currency, and (optional) billing cycle for Subcription
$return_url // URL to redirect your customer back to after they authenticate or cancel their payment
\VaahStripe::subscription($customer, $card, $address, $price_id, $return_url);
$request => [
'name' => 'xxxxxx',
'description' => 'xxxxxx'
];
\VaahStripe::createProduct($request);
$request => [
'product_id' => 'xxxxxx',
'currency' => 'usd',
'amount' => '01',
'interval' => '01'
];
\VaahStripe::createPrice($request);
\VaahStripe::findProductByName($name);
$product_id
$value //optional
$by //optional default = amount amount/currency/interval
\VaahStripe::getProductPrice($product_id, $value, $by);
'aliases' => [
...
'VaahCountry' => \WebReinvent\VaahExtend\Facades\VaahCountry::class,
...
]
'aliases' => [
...
'VaahMail' => WebReinvent\VaahExtend\Facades\VaahMail::class,
...
]
'aliases' => [
...
'VaahImap' => WebReinvent\VaahExtend\Facades\VaahImap::class,
...
]
$customer => [
'name' => 'xxxxxx',
'email' => '[email protected] '
];
$card => [
'number' => 'xxxx-xxxx-xxxx-xxxx',
'exp_month' => '01', // 01-12
'exp_year' => '2021',
'cvc' => 'xxx'
];
$package => [
'currency' => 'usd', // usd / USD
'amount' => '01',
'description' => 'xxxxxx'
];
$address => [
'city' => 'xxxxxx', // optional
'country' => 'xxxxxx',
'line1' => 'xxxxxx',
'line2' => 'xxxxxx', // optional
'postal_code' => '123456', // optional
'state' => 'xxxxxx' // optional
];
$return_url // URL to redirect your customer back to after they authenticate or cancel their payment
\VaahStripe::pay($customer, $card, $package, $address, $return_url);