PHP code example of lotuashvili / laravel-smsoffice
1. Go to this page and download the library: Download lotuashvili/laravel-smsoffice library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lotuashvili / laravel-smsoffice example snippets
'providers' => [
# Other providers
Lotuashvili\LaravelSmsOffice\SmsOfficeServiceProvider::class,
],
class User extends Authenticatable
{
# Code...
public function routeNotificationForSms()
{
return $this->phone;
}
}
use Illuminate\Notifications\Notification;
use Lotuashvili\LaravelSmsOffice\SmsOfficeChannel;
class FooNotification extends Notification
{
public function via($notifiable)
{
return [SmsOfficeChannel::class];
}
public function toSms($notifiable)
{
return 'Test Notification';
}
}
$user->notify(new FooNotification)
use Lotuashvili\LaravelSmsOffice\SmsOffice;
public function sendSms(SmsOffice $smsoffice)
{
$smsoffice->send('599123123', 'Test Message');
}
use Lotuashvili\LaravelSmsOffice\SmsOffice;
public function getBalance(SmsOffice $smsoffice)
{
$smsoffice->balance();
}