Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Courier Fraud Checker Bd Laravel Package

shahariar-ahmad/courier-fraud-checker-bd

View on GitHub
Deep Wiki
Context7

Courier Fraud Checker BD for Laravel

A Laravel package to detect potential fraudulent orders by checking customer delivery behavior through Pathao and Steadfast courier services in Bangladesh.


โœจ Features

  • Check customer delivery history across multiple couriers
  • Validate Bangladeshi phone numbers
  • Get success/cancel/total delivery statistics
  • Supports both Pathao and Steadfast courier services

โš™๏ธ Installation

Install via Composer:

composer require shahariar-ahmad/courier-fraud-checker-bd

Add Service Provider (Laravel 5.4 and below)

In config/app.php:

'providers' => [
    ShahariarAhmad\CourierFraudCheckerBd\CourierFraudCheckerBdServiceProvider::class,
],

Add Facade Alias (optional)

In config/app.php:

'aliases' => [
    'CourierFraudCheckerBd' => ShahariarAhmad\CourierFraudCheckerBd\Facade\CourierFraudCheckerBd::class,
],

๐Ÿ”ง Configuration

Add these environment variables to your .env file:

# Pathao Credentials
PATHAO_USER=your_pathao_email
PATHAO_PASSWORD=your_pathao_password

# Steadfast Credentials
STEADFAST_USER=your_steadfast_email
STEADFAST_PASSWORD=your_steadfast_password

๐Ÿš€ Usage

Basic Usage

use CourierFraudCheckerBd;

$result = CourierFraudCheckerBd::check('01886607475');

print_r($result);

Output:

[
    'pathao' => ['success' => 5, 'cancel' => 2, 'total' => 7],
    'steadfast' => ['success' => 3, 'cancel' => 1, 'total' => 4]
]

โ˜Ž๏ธ Phone Number Validation

The package automatically validates phone numbers with this regex:

/^01[3-9][0-9]{8}$/

โœ… Valid examples:

  • 01712345678
  • 01876543219

โŒ Invalid examples:

  • +8801712345678 (includes country code)
  • 1234567890 (too short)
  • 02171234567 (invalid prefix)

๐Ÿ› ๏ธ Advanced Usage

Using Individual Services

use ShahariarAhmad\CourierFraudCheckerBd\Services\PathaoService;
use ShahariarAhmad\CourierFraudCheckerBd\Services\SteadfastService;

$pathao = (new PathaoService())->pathao('01712345678');
$steadfast = (new SteadfastService())->steadfast('01712345678');

Custom Validation Rules

use ShahariarAhmad\CourierFraudCheckerBd\Helpers\CourierFraudCheckerHelper;

CourierFraudCheckerHelper::validatePhoneNumber('01712345678');

๐Ÿงน Troubleshooting

Common Issues

  1. Missing Environment Variables

    • Ensure all required credentials are set in .env
    • Run php artisan config:clear after updating
  2. Invalid Phone Number Format

    • Must use local (BD) format like 01712345678
    • Do not include +88 prefix

๐Ÿ“ License

This package is open-source software licensed under the GNU General Public License v3.0 (GPL-3.0).

Under this license:

โœ… You are allowed to:

  • Use the package for personal or commercial projects.
  • Modify the source code for your own use.
  • Distribute the modified or original source code provided you also license it under GPL-3.0.
  • Study and learn from the source code freely.

โŒ You are NOT allowed to:

  • Re-license the package under a different license.
  • Distribute the package as part of a proprietary/commercial closed-source software without making your source code public.
  • Sub-license or sell the software under a restrictive license.

Important:
If you distribute modified versions of this package, you must also release your changes under the GPL-3.0 license and include the original copyright.

GPL-3.0 promotes freedom to use, share, and modify, but ensures that any distributed version remains free and open-source.


๐Ÿ’ฌ Support

For issues and feature requests:

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle