- How do I install amirbagh75/smsir-php in a Laravel app?
- The package ships a Laravel service provider, facade, and config file, so installation is typically composer require amirbagh75/smsir-php, publish the config, then set your sms.ir API key and line number. For a basic happy path, expect under a day of work. The real friction is usually version constraints and API-generation drift, not the initial wiring.
- Does amirbagh75/smsir-php support Laravel 11 and Laravel 12?
- That is not guaranteed from the available context. The package is unofficial, has a single maintainer, and its last release was February 2023, so it likely targets the Laravel 9/10 and PHP version line from that period. Pin PHP and Laravel constraints explicitly, and assume you may need a fork or a thin in-house replacement on newer Laravel versions.
- What SMS.ir features does this package support?
- The package is described as making it easy to send SMS messages, use verification codes, and manage SMS-related features from PHP or Laravel applications. It is less clear whether it covers every current sms.ir capability such as template/verify sends, bulk endpoints, delivery reports, line status, and credit balance. Verify the exact endpoint coverage before relying on it for critical workflows.
- How do I configure the sms.ir API key and line number?
- The typical setup is to publish the package config file, then provide your sms.ir API key and line number through config or environment variables. Audit whether the package defaults the API key to a plain config file rather than a secret manager, and never hard-code credentials. Also check whether its config keys collide with existing application config.
- Can I use amirbagh75/smsir-php for OTP and verification code sends?
- The package advertises verification code support, so OTP is a likely use case. However, retry, backoff, and idempotency support are likely absent, which matters most on the OTP path. Keep OTP on a known-good path or dual-send to a second number until failure rate and latency are proven over a couple of weeks.
- How are SMS.ir API errors handled in this package?
- There is no visible guarantee of typed exceptions, sms.ir error codes, or a clear exception model, so errors may be generic or even swallowed. Test provider failures in staging rather than assuming successful requests mean correct behavior. Put the package behind one adapter class so you can normalize errors and swap implementations if needed.
- Is amirbagh75/smsir-php maintained and safe for production?
- It is an unofficial package with about 17 stars, a single maintainer, and a last release in February 2023, so you are effectively adopting the code rather than a supported product. The MIT license is permissive and the scope is small enough to fork and own if needed. Audit the source, run composer audit, pin to a commit SHA, and check whether message bodies or OTP codes are logged.
- Does amirbagh75/smsir-php have tests, CI, or static analysis?
- The available context does not show a guarantee of tests, CI, static analysis, or a maintained quality process. Treat those as unknown until you inspect the repository and its release history. Run PHPStan, a composer audit, and a staging smoke test against real test credentials before adoption.
- What is the best alternative to amirbagh75/smsir-php for Laravel?
- If you want to avoid an unofficial, low-scrutiny dependency, call the sms.ir REST API directly with Laravel's HTTP client, or use an official sms.ir SDK if one exists and fits your needs. You can also keep other providers such as Kavenegar or Ghasedak behind the same internal contract. A direct HTTP implementation doubles as a fallback and a way to diff response shapes against the package.
- How should I integrate SMS.ir into a layered Laravel app without coupling domain code?
- Define an internal SmsGateway contract for send, sendVerify, and deliveryStatus, then implement it with this package in exactly one infrastructure adapter class. Do not import the vendor facade directly in domain code. Resolve the implementation from config so switching providers or moving to an in-house HTTP adapter is a config change, and run contract tests against both adapters in staging.