#####Version 1.0
- A Twilio account for sms service. Sign Up
- Twilio PHP Helper Library
- Select2 Widget
- Grid Module
- yii2-ajaxcrud
The recommended method for installing sms-yii2 is via Composer. This will also install the dependencies automatically. To be able to install this package, you need to tell your project's composer.json to search this repository. To do that, add the following to your composer.json file.
"repositories": [
{
"type": "vcs",
"url": "[email protected]:TempleSuite/sms-yii2.git"
}
],
Then you can run the following command:
composer require maissoftware/sms-yii2 "@dev"
* NOTE: If you do not have access to this private package with the use of an SSH key, the
installation will fail.
- Add the module to your project config file. For example, "project/frontend/config/main.php"
'sms' => [
'class' => 'maissoftware\sms\SMS', //Path to module
'phoneColumn' => 'phone_number', //The name of your phone column in the user table in database
'phoneTable' => 'phone_number', //Used if phone numbers are stored in a different table in database
'phoneUserIdColumn' => 'entity_id', //The name of the user id column in the phone table
],
- Use the create view to add your Twilio account information to your database
- The Grid module dependency also needs to be added to your configuration file if it is not already there.
'gridview'=> [
'class' => '\kartik\grid\Module'
],
- make sure you also run the migrations to create the required tables.
- Migration will only work if you have a "user" table with the id column "id"