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

Symfony Sms Bundle Laravel Package

cspoo/symfony-sms-bundle

View on GitHub
Deep Wiki
Context7

symfony-sms-bundle

Symfony2 bundle for supporting SMS

Activate the bundle

In your AppKernel:

    new cspoo\SmsBundle\cspooSmsBundle(),

Example of configuration

# config.yml
cspoo_sms:
    default_transport: winic
    transports:
        -
            name: winic
            type: winic
            username: foo
            password: bar

Usage in controller

        $smsSender = $this->container->get('sms');
        $sms = $smsSender->createSms($phone, $token);
        $smsSender->sendSms($sms);

Adding your own provider

If you have a provider that needs a username/password you can simply add it by doing these steps

Create a Transport class

In the Transport folder add a classe MyOwnTransport.php and put in it

<?php

namespace cspoo\SmsBundle\Transport;

use cspoo\SmsBundle\Model\Sms;

class WinicTransport extends BaseTransport
{

    public function getName()
    {
        return 'name of the provider';
    }

    public function sendSms(Sms $sms)
    {
        $id = urlencode($this->getUsername());
        $password = urlencode($this->getPassword());
        $to = urlencode($sms->getRecipient());
        $content = urlencode($sms->getMessage());

        // your provider specific code

        // return whatever you want
        return 42;
    }
}

Add your Transport class in the SMS factory

In the Services folder you can edit SmsFactory.php to populate the loadTransport method with your new class

Add your Transport name in the list of possible configuration parameter

In DependencyInjection/Configuration.php you can provider name in the list of possible entry

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.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
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