With this package, you can send a single or multiple SMS using Mutlucell infrastructure in your laravel projects, and query the balance and Originator ID.
The package supports all versions of Laravel 4 and above.
It contains warning and information messages in Turkish and English languages for warning, error and information.
First, add the package to your composer.json package with composer require ardakilic/mutlucell command.
Then, if you updated the composer.json file with your hand, you should update your Composer packages to include the codes in your project. You can do this with the composer install command.
(For Laravel only for Laravel 5.5) Now open config/app.php file, enter the providers series at the most alta:
Ardakilic Mutlucell MutlucellServiceProvider::class, (For Laravel only for older versions than 5.5) Enter the following value under aliases series in the same file:
' Mutlucell ' => Ardakilic Mutlucell Facades Mutlucell::class,Now you must share the configuration file to your Environment. Run the command below for this:
php artisan vendor:publish config/mutlucell.php file will be shared. Here you must fill out the user name, password and sender_id (Originator) values, and other settings assigned to you for Mutlucell.
You can also feed your Config file by filling out the values of MUTLUCELL_USERNAME , MUTLUCELL_PASSWORD and MUTLUCELL_DEFAULT_SENDER to your Environment file.
$ send = Mutlucell:: send ( ' 05312345678 ' , ' Merhaba ' );
var_dump (Mutlucell:: parseOutput ( $ send )); $ send = Mutlucell:: send ( ' 05312345678 ' , ' Merhaba ' );
if (Mutlucell:: getStatus ( $ send )) {
echo ' SMS başarı ile gönderildi! ' ;
} else {
echo ' SMS gönderilemedi ' ;
}You need an SMS ID value to follow the status of the message (whether it reaches the other side).
In the figure below, you can make SMS ID and then query it with it.
$ send = Mutlucell:: send ( ' 05312345678 ' , ' Merhaba ' );
if (Mutlucell:: getStatus ( $ send )) {
$ messageId = Mutlucell:: getMessageId ( $ send );
echo ' SMS başarı ile gönderildi! SMS ID: ' . $ messageId ;
} else {
echo ' SMS gönderilemedi ' ;
} $ kisiler = [ ' 00905312345678 ' , ' +905351114478 ' , ' 05369998874 ' , ' 5315558896 ' ];
$ send = Mutlucell:: sendBulk ( $ kisiler , ' Merhaba ' );
var_dump (Mutlucell:: parseOutput ( $ send ));Or
$ send = Mutlucell:: sendBulk ( ' 00905312345678, +905351114478, 05369998874, 5315558896 ' , ' Merhaba ' );
Mutlucell:: parseOutput ( $ send ); $ kisiMesajlar = [
[ ' 05315558964 ' , ' Merhaba1 ' ],
[ ' +905415589632 ' , ' Merhaba2 ' ],
[ ' 00905369998874 ' , ' Merhaba3 ' ]
];
$ send = Mutlucell:: sendMulti ( $ kisiMesajlar );
var_dump (Mutlucell:: parseOutput ( $ send ));Or
$ kisiMesajlar = [
[ ' 05315558964 ' => ' Merhaba1 ' ],
[ ' +905415589632 ' => ' Merhaba2 ' ],
[ ' 00905369998874 ' => ' Merhaba3 ' ]
];
$ send = Mutlucell:: sendMulti2 ( $ kisiMesajlar );
var_dump (Mutlucell:: parseOutput ( $ send ));>>> M utlucell::getMessageReport( ' 1234567890 ' ) ;
= > [
[
" number " => " 905321234567 " ,
" result " => " 3 " ,
" result_text " => " Başarılı " ,
],
] $ sil = Mutlucell:: addBlacklist ( ' 00905312345678 ' );
var_dump (Mutlucell:: parseOutput ( $ sil ));Or
$ sil = Mutlucell:: addBlacklist ( ' 00905312345678, +905351114478, 05369998874, 5315558896 ' );
var_dump (Mutlucell:: parseOutput ( $ sil ));Or
$ kisiler = [ ' 00905312345678 ' , ' +905351114478 ' , ' 05369998874 ' , ' 5315558896 ' ];
$ sil = Mutlucell:: addBlacklist ( $ kisiler );
var_dump (Mutlucell:: parseOutput ( $ sil )); $ sil = Mutlucell:: deleteBlackList ( ' 00905312345678 ' );
var_dump (Mutlucell:: parseOutput ( $ sil ));Or
$ sil = Mutlucell:: deleteBlackList ( ' 00905312345678, +905351114478, 05369998874, 5315558896 ' );
var_dump (Mutlucell:: parseOutput ( $ sil ));Or
$ kisiler = [ ' 00905312345678 ' , ' +905351114478 ' , ' 05369998874 ' , ' 5315558896 ' ];
$ sil = Mutlucell:: deleteBlackList ( $ kisiler );
var_dump (Mutlucell:: parseOutput ( $ sil ));If you want to remove all users from the black list, the parameter must be empty:
$ sil = Mutlucell:: deleteBlackList ();
var_dump (Mutlucell:: parseOutput ( $ sil )); $ gonder = Mutlucell:: setConfig ( config ( ' app.baskaConfig ' ))
-> send ( ' 05312345678 ' , ' Merhaba ' );Even
$ sms = Mutlucell:: setConfig ([
' auth ' => [
' username ' => ' baskauser ' ,
' password ' => ' baskaparola ' ,
],
' default_sender ' => ' baskaoriginator ' ,
]);
$ sms -> send ( ' 05312345678 ' , ' Merhaba ' ); var_dump (Mutlucell:: checkBalance ()); var_dump (Mutlucell:: listOriginators ());Mutlucell:: send ( ' 05312223665 ' , ' Geç gidecek mesaj ' , ' 2099-06-30 15:00 ' ); // Saniye yok, dikkat! Mutlucell:: send ( ' 05312223665 ' , ' merhaba ' , '' , ' diğerOriginator ' );This software package is licensed with MIT license.
If this project has worked for you, you can donate to me with crypto coins. You can find my wallet addresses below:
BTC: 1qfhesrhwwwvhmnedbkarkvpMPPF7P6
ETH / ERC20 TOKENS: 0x3C2B0AC49257300DAB96DF8B49D254BBB696B3458