JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrlaravel-payhere/composer.json000064400000003374150364332370012364 0ustar00{ "name": "lahirulhr/laravel-payhere", "description": "API integration for PayHere payment gateway in Sri Lanka", "keywords": [ "lahirulhr", "laravel", "laravel-payhere" ], "homepage": "https://github.com/lahirulhr/laravel-payhere", "license": "MIT", "authors": [ { "name": "LaHiRu", "email": "lahirulhr@gmail.com", "role": "Developer" } ], "require": { "php": "^8.0", "guzzlehttp/guzzle": "^7.4", "illuminate/contracts": "^10.0", "spatie/laravel-package-tools": "^1.9.2" }, "require-dev": { "nunomaduro/collision": "^6.0", "orchestra/testbench": "^8.0", "pestphp/pest": "^1.23", "pestphp/pest-plugin-laravel": "^1.4", "phpunit/phpunit": "^9.6.0" }, "autoload": { "psr-4": { "Lahirulhr\\PayHere\\": "src", "Lahirulhr\\PayHere\\Database\\Factories\\": "database/factories" } }, "autoload-dev": { "psr-4": { "Lahirulhr\\PayHere\\Tests\\": "tests" } }, "scripts": { "phpstan": "vendor/bin/phpstan analyse", "test": "vendor/bin/pest", "test-coverage": "vendor/bin/pest coverage" }, "config": { "sort-packages": true, "allow-plugins": { "pestphp/pest-plugin": true, "phpstan/extension-installer": true } }, "extra": { "laravel": { "providers": [ "Lahirulhr\\PayHere\\PayHereServiceProvider" ], "aliases": { "PayHere": "Lahirulhr\\PayHere\\PayHereFacade" } } }, "minimum-stability": "dev", "prefer-stable": true } laravel-payhere/.php_cs.dist.php000064400000002402150364332370012636 0ustar00in([ __DIR__ . '/src', __DIR__ . '/tests', ]) ->name('*.php') ->notName('*.blade.php') ->ignoreDotFiles(true) ->ignoreVCS(true); return (new PhpCsFixer\Config()) ->setRules([ '@PSR12' => true, 'array_syntax' => ['syntax' => 'short'], 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, 'trailing_comma_in_multiline' => true, 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, 'blank_line_before_statement' => [ 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], ], 'phpdoc_single_line_var_spacing' => true, 'phpdoc_var_without_name' => true, 'class_attributes_separation' => [ 'elements' => [ 'method' => 'one', ], ], 'method_argument_space' => [ 'on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => true, ], 'single_trait_insert_per_statement' => true, ]) ->setFinder($finder); laravel-payhere/phpstan-baseline.neon000064400000000000150364332370013737 0ustar00laravel-payhere/src/Api/Refund.php000064400000001205150364332370013065 0ustar00form_data['payment_id'] = $payment_id; return $this; } public function makePaymentAuthorizationRefund(string $authorization_token) { $this->form_data['authorization_token'] = $authorization_token; return $this; } public function note(string $note) { $this->form_data['description'] = $note; return $this; } } laravel-payhere/src/Api/Capture.php000064400000001154150364332370013250 0ustar00form_data['authorization_token'] = $authorization_token; return $this; } public function amount(float $amount) { $this->form_data['amount'] = $amount; return $this; } public function reason(string $reason = "") { $this->form_data['deduction_details'] = $reason; return $this; } } laravel-payhere/src/Api/Checkout.php000064400000000245150364332370013412 0ustar00form_data['customer_token'] = $token; return $this; } } laravel-payhere/src/Api/Retrieve.php000064400000000540150364332370013430 0ustar00url = $this->url.trim($order_id); return $this; } } laravel-payhere/src/Api/Subscription.php000064400000001767150364332370014343 0ustar00method = "get"; $this->url = "merchant/v1/subscription"; return $this->submit(); } public function getPaymentsOfSubscription(string $subscription_id) { $this->method = "get"; $this->url = "merchant/v1/subscription/$subscription_id/payments"; return $this->submit(); } public function retry(string $subscription_id) { $this->method = "post"; $this->url = "merchant/v1/subscription/retry"; $this->form_data['subscription_id'] = $subscription_id; return $this->submit(); } public function cancel(string $subscription_id) { $this->method = "post"; $this->url = "merchant/v1/subscription/cancel"; $this->form_data['subscription_id'] = $subscription_id; return $this->submit(); } } laravel-payhere/src/Api/Recurring.php000064400000002323150364332370013604 0ustar00required_data['recurrence'] = "$weeks Week"; return $this; } public function chargeMonthly($months = 1) { $this->required_data['recurrence'] = "$months Month"; return $this; } public function chargeAnnually($years = 1) { $this->required_data['recurrence'] = "$years Year"; return $this; } public function forWeeks($weeks = 1) { $this->required_data['duration'] = "$weeks Week"; return $this; } public function forMonths($months = 1) { $this->required_data['duration'] = "$months Month"; return $this; } public function forYears($years = 1) { $this->required_data['duration'] = "$years Year"; return $this; } public function forForever() { $this->required_data['duration'] = "Forever"; return $this; } public function renderView() { $action = $this->getFullApiUrl(); $data = $this->getFormData(); return view("payhere::recurring", compact('action', 'data')); } } laravel-payhere/src/Api/Authorize.php000064400000000247150364332370013621 0ustar00json(["error" => true, "message" => $this->getMessage()]); } } laravel-payhere/src/Helpers/PayHereRestClient.php000064400000004554150364332370016077 0ustar00form_data = $data; return $this; } public function getAccessToken() { $url = config('payhere.api_endpoint') . "merchant/v1/oauth/token"; $data = Http::asForm()->withToken($this->generateAuthCode(), 'Basic') ->post($url, [ 'grant_type' => 'client_credentials', ]); return $data->json()['access_token'] ?? null; } public function generateAuthCode() { return base64_encode(config('payhere.app_id') . ":" . config('payhere.app_secret')); } public function cachedAccessToken() { return Cache::remember('payhere-access-token', now()->addSeconds(560), function () { return $this->getAccessToken(); }); } public function generateHash($orderId, $amount, $currency = 'LKR') { return strtoupper( md5( config('payhere.merchant_id') . $orderId . number_format($amount, 2, '.', '') . $currency . strtoupper(md5(config('payhere.merchant_secret'))) ) ); } /** * @throws PayHereException */ public function submit() { if ($this->method == "post") { $client = Http::asJson() ->withToken($this->cachedAccessToken()) ->post(config('payhere.api_endpoint') . $this->url, $this->form_data); } else { $client = Http::withToken($this->cachedAccessToken()) ->get(config('payhere.api_endpoint') . $this->url, $this->form_data); } $output = $client->json(); if (! $output) { throw new PayHereException("No data from API !"); } if (array_key_exists('error', $output)) { throw new PayHereException($output['error_description']); } if (array_key_exists('status', $output) && $output['status'] < 0) { throw new PayHereException($output['msg']); } return $output; } } laravel-payhere/src/Helpers/PayHereClient.php000064400000003153150364332370015233 0ustar00required_data = $array; return $this; } public function successUrl($url) { $this->success_url = $url; return $this; } public function failUrl($url) { $this->fail_url = $url; return $this; } private function setNotifyUrl() { $this->notify_url = route('payhere.callback', $this->getCallbackKey()); } public function setOptionalData($data) { $this->optional_data = $data; } private function authData() { return [ 'merchant_id' => config('payhere.merchant_id'), 'return_url' => $this->success_url, 'cancel_url' => $this->fail_url, 'notify_url' => $this->notify_url, ]; } public function getFormData() { $this->setNotifyUrl(); return array_merge($this->authData(), $this->required_data, $this->optional_data); } public function getFullApiUrl() { return config('payhere.api_endpoint') . $this->url; } public function renderView() { $action = $this->getFullApiUrl(); $data = $this->getFormData(); return view("payhere::recurring", compact('action', 'data')); } public static function getCallbackKey() { return base64_encode(get_called_class()); } } laravel-payhere/src/PayHereFacade.php000064400000000377150364332370013563 0ustar00all())); break; case Checkout::getCallbackKey(): event(new CheckoutCallbackEvent($request->all())); break; case Recurring::getCallbackKey(): event(new RecurringCallbackEvent($request->all())); break; case PreApproval::getCallbackKey(): event(new PreapprovalCallbackEvent($request->all())); break; case "test": // emit event two dd('test'); break; } } } laravel-payhere/src/PayHereServiceProvider.php000064400000001346150364332370015530 0ustar00name('laravel-payhere') ->hasRoute('web') ->hasConfigFile() ->hasViews(); // ->hasMigration('create_laravel-payhere_table') // ->hasCommand(PayHereCommand::class); } } laravel-payhere/src/Events/AuthorizeCallbackEvent.php000064400000000747150364332370017000 0ustar00payload = $payload; } } laravel-payhere/src/Events/RecurringCallbackEvent.php000064400000000747150364332370016766 0ustar00payload = $payload; } } laravel-payhere/src/Events/PreapprovalCallbackEvent.php000064400000000751150364332370017314 0ustar00payload = $payload; } } laravel-payhere/src/Events/CheckoutCallbackEvent.php000064400000000746150364332370016572 0ustar00payload = $payload; } } laravel-payhere/src/PayHere.php000064400000002307150364332370012472 0ustar00comment('All done'); return self::SUCCESS; } } laravel-payhere/README.md000064400000027776150364332370011135 0ustar00# Laravel PayHere [![Latest Version on Packagist](https://img.shields.io/packagist/v/lahirulhr/laravel-payhere.svg?style=flat-square)](https://packagist.org/packages/lahirulhr/laravel-payhere) [![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/lahirulhr/laravel-payhere/run-tests?label=tests)](https://github.com/lahirulhr/laravel-payhere/actions?query=workflow%3Arun-tests+branch%3Amain) [![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/lahirulhr/laravel-payhere/Check%20&%20fix%20styling?label=code%20style)](https://github.com/lahirulhr/laravel-payhere/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/lahirulhr/laravel-payhere.svg?style=flat-square)](https://packagist.org/packages/lahirulhr/laravel-payhere)
[](http://laravel.com)
[](http://payhere.lk)
Laravel - PayHere was made to manage PayHere payment gateway on your laravel application with ease. currently this package supports all available methods on official PayHere documentation. Read official [Documentation](https://support.payhere.lk/api-&-mobile-sdk/payhere-checkout) for more information #### Available API methods ✔️ Checkout API ✔️ Recurring API ✔️ Preapproval API ✔️ Charging API ✔️ Retrieval API ✔️ Subscription Manager API ✔️ Refund API ✔️ Authorize API ✔️ Capture API ###### Basic Usage ```php // adding payment details $data = [ 'first_name' => 'Lahiru', 'last_name' => 'Tharaka', 'email' => 'lahirulhr@gmail.com', 'phone' => '+94761234567', 'address' => 'Main Rd', 'city' => 'Anuradhapura', 'country' => 'Sri lanka', 'order_id' => '45552525005', 'items' => 'Smart band MI 4 - BLACK', 'currency' => 'LKR', 'amount' => 4960.00, ]; // creating checkout page & redirect user return PayHere::checkOut() ->data($data) ->successUrl('www.visanduma.com/payment-success') ->failUrl('www.visanduma.com/payment-fail') ->renderView(); ``` ## Installation You can install the package via composer: ```bash composer require lahirulhr/laravel-payhere ``` You can publish the config file with: ```bash php artisan vendor:publish --provider="Lahirulhr\PayHere\PayHereServiceProvider" --tag="laravel-payhere-config" ``` This is the contents of the published config file: ```php return [ /* PayHere action url. usually, for production https://www.payhere.lk for testing https://sandbox.payhere.lk remember to update api when production * */ 'api_endpoint' => env('PAYHERE_API'), /* PayHere merchant ID can be found in their dashboard https://www.payhere.lk/account/settings/domain-credentials * */ 'merchant_id' => env('PAYHERE_MERCHANT_ID'), /* Merchant Secret is specific to each App/Domain. it can be generated for your domain/app as follows https://www.payhere.lk/account/settings/domain-credentials *Click 'Add Domain/App' > Fill details > Click 'Request to Allow' *Wait for the approval for your domain *Copy the Merchant Secret for your domain/app to .env file * */ 'merchant_secret' => env('PAYHERE_MERCHANT_SECRET'), /* Follow PayHere official instructions to obtain 'app_id' and 'app_secret'. NOTE: you dont need to generate "Authorization code". it will be automatically generate by this package *Sign in to your PayHere account & go to Settings > Business Apps section *Click 'Create App' button & enter an app name & comma seperated domains to whilelist *Tick the permission 'Payment Retrieval API' *Click 'Add Business App' button to create the app *Once the app is created click 'View Credential' button in front of the created app *Copy the 'App ID' & 'App Secret' values * */ 'app_id' => env('PAYHERE_APP_ID'), 'app_secret' => env('PAYHERE_APP_SECRET'), ``` ## Usage ###### [Checkout API](https://support.payhere.lk/api-&-mobile-sdk/payhere-checkout) Checkout API lets you integrate PayHere with your website, web application or any other application in code level. It offers a simple HTML Form to initiate a payment request and redirect your customer to PayHere Payment Gateway to securely process the payment. ```php // in your controller use Lahirulhr\PayHere\PayHere; // prepair posting data $data = [ 'first_name' => 'Lahiru', 'last_name' => 'Tharaka', 'email' => 'lahirulhr@gmail.com', 'phone' => '+94761234567', 'address' => 'Main Rd', 'city' => 'Anuradhapura', 'country' => 'Sri lanka', 'order_id' => '45552525005', 'items' => 'Smart band MI 4 - BLACK', 'currency' => 'LKR', 'amount' => 4960.00, ]; // creating checkout page & ridirect the user return PayHere::checkOut() ->data($data) ->setOptionalData() // Set optional data. see PayHere documantaion for available values ->successUrl('www.visanduma.com/success') ->failUrl('www.visanduma.com/fail') ->renderView(); ``` #### Handling the server callback PayHere will be notify your application with response data using public url POST request callback. then this package will emit new event with their callback data. you just need to listen on event and do any thing you want with payload data. ```php // define listners in your EventServiceProvider.php class EventServiceProvider extends ServiceProvider { use Lahirulhr\PayHere\Events\CheckoutCallbackEvent; /** * The event listener mappings for the application. * * @var array */ protected $listen = [ CheckoutCallbackEvent::class => [ // register listners to do something with callback ], ]; } ``` ###### [Recurring API](https://support.payhere.lk/api-&-mobile-sdk/payhere-recurring) Recurring API is accept data array same as checkout API. the only things you need to change checkOut() method to recurring(). ```php return PayHere::recurring() ->data($data) ->setOptionalData() // Set optional data. see PayHere documantaion for available values ->successUrl('www.visanduma.com/success') ->failUrl('www.visanduma.com/fail') ->chargeMonthly(2) ->forYears() ->renderView(); ``` The following options are available for making adjustment to recurring period ```php // Charging interval (Recurrence) PayHere::recurring()->chargeWeekly(2) // charge per specific period of weeks .the default value is one week PayHere::recurring()->chargeMonthly(3) // charge per specific period of months .the default value is one month PayHere::recurring()->chargeAnnually() // charge per specific period of years .the default value is one year // Duration to charge PayHere::recurring()->forWeeks(6) // set duratoin by weeks .the default value is one week PayHere::recurring()->forMonths(3) // set duratoin by months .the default value is one month PayHere::recurring()->forYears() // set duratoin by years .the default value is one year PayHere::recurring()->forForever() // set charging period to infinity. ``` ```php // use this event to recieve server callback. see above example on Checkout API RecurringCallbackEvent::class ``` ###### [Preapproval API](https://support.payhere.lk/api-&-mobile-sdk/payhere-preapproval) Use same as checkout method ```php return PayHere::preapproval() ->data($data) ->setOptionalData() // Set optional data. see PayHere documantaion for available values ->successUrl('www.visanduma.com/payment-success') ->failUrl('www.visanduma.com/payment-fail') ->renderView(); ``` ```php // use this event to recieve server callback. see above example on Checkout API PreapprovalCallbackEvent::class ``` ###### [Charging API](https://support.payhere.lk/api-&-mobile-sdk/payhere-charging) Charging API lets you charge your preapproved customers programatically on demand using the encrypted tokens. it will return response data array on success or return PayHereException if any error. ```php $data = [ "type" => "PAYMENT", "order_id" => "Order12345", "items" => "Taxi Hire 123", "currency" => "LKR", "amount" => 345.67, ]; $response = PayHere::charge() ->byToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") // customer token ->withData($data) ->submit(); ``` ###### [Retrieval API](https://support.payhere.lk/api-&-mobile-sdk/payhere-retrieval) Retrieval API lets you retrieve the details of the Successful payments processed through your PayHere ```php $info = PayHere::retrieve() ->orderId("od-43784658374534") // order number that you use to charge from customer ->submit(); ``` ##### [Subscription Manager](https://support.payhere.lk/api-&-mobile-sdk/payhere-subscription) Subscription Manager API lets you view, retry & cancel your subscription customers programmatically you subscribed from Recurring API. ```php // get all subscriptions $subscriptions = PayHere::subscription()->getAll(); // get payment details of specific subscription $paymentInfo = PayHere::subscription() ->getPaymentsOfSubscription("420075032251"); // subscription ID // retry on failed supscription payments PayHere::subscription() ->retry("420075032251"); // subscription ID // cancel a subscription PayHere::subscription() ->cancel("420075032251"); // subscription ID ``` ###### [Refund API](https://support.payhere.lk/api-&-mobile-sdk/payhere-refund) Refund API lets you refund your existing payment programmatically. ```php PayHere::refund() ->makePaymentRefund('320027150501') // payment_id ->note("Out of stock") // note for refund ->submit(); ``` ###### [Authorize API](https://support.payhere.lk/api-&-mobile-sdk/payhere-authorize) Authorize API allows you to get your customer authorization for Hold on Card payments. this method will redirect user to payment page ```php // use same $data as Checkout method return PayHere::authorize() ->data($data) ->successUrl('www.visanduma.com/success') ->failUrl('www.visanduma.com/fail') ->renderView(); ``` ```php // use this event to recieve server callback. see above example on Checkout API AuthorizeCallbackEvent::class ``` ###### [Capture API](https://support.payhere.lk/api-&-mobile-sdk/payhere-capture) Capture API lets you capture your authorized Hold on Card payments programmatically on demand using the authorization tokens you retrieved from Payment Authorize API. ```php $response = PayHere::capture() ->usingToken('e34f3059-7b7d-4b62-a57c-784beaa169f4') // authorization token ->amount(100) // charging amount ->reason("reason for capture") ->submit(); ``` --- ## TODO - [x] ~~Events for server callbacks~~ - [ ] Custom payment redirection page - [ ] Custom Error types - [ ] Response Data Objects - [ ] Optional Data handling - [ ] Inbuilt subscription database - [ ] Server callback log ## Testing ```bash composer test ``` ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Contributing Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. ## Security Vulnerabilities Please review [our security policy](../../security/policy) on how to report security vulnerabilities. ## Credits - [LaHiRu](https://github.com/lahirulhr) - [All Contributors](../../contributors) ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information. laravel-payhere/config/payhere.php000064400000003242150364332370013247 0ustar00 env('PAYHERE_API'), /* PayHere merchant ID can be found in their dashboard https://www.payhere.lk/account/settings/domain-credentials * */ 'merchant_id' => env('PAYHERE_MERCHANT_ID'), /* Merchant Secret is specific to each App/Domain. it can be generated for your domain/app as follows https://www.payhere.lk/account/settings/domain-credentials *Click 'Add Domain/App' > Fill details > Click 'Request to Allow' *Wait for the approval for your domain *Copy the Merchant Secret for your domain/app to .env file * */ 'merchant_secret' => env('PAYHERE_MERCHANT_SECRET'), /* Follow PayHere official instructions to obtain 'app_id' and 'app_secret'. NOTE: you dont need to generate "Authorization code". it will be automatically generate by this package *Sign in to your PayHere account & go to Settings > Business Apps section *Click 'Create App' button & enter an app name & comma seperated domains to whilelist *Tick the permission 'Payment Retrieval API' *Click 'Add Business App' button to create the app *Once the app is created click 'View Credential' button in front of the created app *Copy the 'App ID' & 'App Secret' values * */ 'app_id' => env('PAYHERE_APP_ID'), 'app_secret' => env('PAYHERE_APP_SECRET'), ]; laravel-payhere/LICENSE.md000064400000002105150364332370011235 0ustar00The MIT License (MIT) Copyright (c) lahirulhr Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. laravel-payhere/database/migrations/create_payhere_table.php.stub000064400000000606150364332370021371 0ustar00id(); // add fields $table->timestamps(); }); } }; laravel-payhere/database/factories/ModelFactory.php000064400000000416150364332370016460 0ustar00 {{ config('app.name') }}

Processing payment ...

Please wait few seconds to continue. you will be automatically redirect to payment page

@foreach($data as $key => $value) @endforeach
laravel-payhere/resources/views/.gitkeep000064400000000000150364332370014421 0ustar00laravel-payhere/CHANGELOG.md000064400000000201150364332370011435 0ustar00# Changelog All notable changes to `laravel-payhere` will be documented in this file. ## 1.0.0 - 202X-XX-XX - initial release laravel-payhere/routes/web.php000064400000000474150364332370012447 0ustar00withoutMiddleware(\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class) ->name('payhere.callback');laravel-payhere/configure.php000064400000012144150364332370012327 0ustar00#!/usr/bin/env php "); writeln("Namespace : {$vendorNamespace}\\{$className}"); writeln("Class name : {$className}"); writeln('------'); writeln('This script will replace the above values in all relevant files in the project directory.'); if (! confirm('Modify files?', true)) { exit(1); } $files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes()); foreach ($files as $file) { replace_in_file($file, [ ':author_name' => $authorName, ':author_username' => $authorUsername, 'author@domain.com' => $authorEmail, ':vendor_name' => $vendorName, ':vendor_slug' => $vendorSlug, 'VendorName' => $vendorNamespace, ':package_name' => $packageName, ':package_slug' => $packageSlug, 'Skeleton' => $className, 'skeleton' => $packageSlug, ':package_description' => $description, ]); match (true) { str_contains($file, 'src/Skeleton.php') => rename($file, './src/' . $className . '.php'), str_contains($file, 'src/SkeletonServiceProvider.php') => rename($file, './src/' . $className . 'ServiceProvider.php'), str_contains($file, 'src/SkeletonFacade.php') => rename($file, './src/' . $className . 'Facade.php'), str_contains($file, 'src/Commands/SkeletonCommand.php') => rename($file, './src/Commands/' . $className . 'Command.php'), str_contains($file, 'database/migrations/create_skeleton_table.php.stub') => rename($file, './database/migrations/create_' . $packageSlugWithoutPrefix . '_table.php.stub'), str_contains($file, 'config/skeleton.php') => rename($file, './config/' . $packageSlugWithoutPrefix . '.php'), default => [], }; } confirm('Execute `composer install` and run tests?') && run('composer install && composer test'); confirm('Let this script delete itself?', true) && unlink(__FILE__); laravel-payhere/phpstan.neon.dist000064400000000423150364332370013132 0ustar00includes: - phpstan-baseline.neon parameters: level: 4 paths: - src - config - database - tests tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true checkMissingIterableValueType: false