Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioPuljiz authored and github-actions[bot] committed Mar 26, 2024
1 parent 181c1f9 commit 23cffa3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/ApiWhatsappBusinessServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class ApiWhatsappBusinessServiceProvider extends ServiceProvider
*/
public function boot(): void
{
if (!class_exists('CreateWhatsappConfigurationsTable')) {
if (! class_exists('CreateWhatsappConfigurationsTable')) {
$this->publishes([
__DIR__ . '/../database/migrations/2023_04_21_110851_create_whatsapp_configurations_table.php' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_whatsapp_configurations_table.php'),
__DIR__.'/../database/migrations/2023_04_21_110851_create_whatsapp_configurations_table.php' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_whatsapp_configurations_table.php'),
]);
}

if (!class_exists('CreateWhatsappNotificationsTable')) {
if (! class_exists('CreateWhatsappNotificationsTable')) {
$this->publishes([
__DIR__ . '/../database/migrations/2024_03_04_161027_create_whatsapp_notifications_table.php' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_whatsapp_notifications_table.php'),
__DIR__.'/../database/migrations/2024_03_04_161027_create_whatsapp_notifications_table.php' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_whatsapp_notifications_table.php'),
]);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/Traits/SendWhatsapp.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use EmilioPuljiz\ApiWhatsappBusiness\Models\WhatsappConfiguration;
use Exception;
use GuzzleHttp\Client;
use EmilioPuljiz\ApiWhatsappBusiness\Traits\UpdateBearer;

trait SendWhatsapp
{
Expand Down Expand Up @@ -60,11 +59,11 @@ public function SendWhatsappNotification($phoneNumber, $template, $vars)

$json_data = json_encode($data);

$url = 'https://graph.facebook.com/v18.0/' . $whatsappConfiguration->phone_number_id . '/messages';
$url = 'https://graph.facebook.com/v18.0/'.$whatsappConfiguration->phone_number_id.'/messages';

$response = $client->request('POST', $url, [
'headers' => [
'Authorization' => 'Bearer ' . $whatsappConfiguration->access_token,
'Authorization' => 'Bearer '.$whatsappConfiguration->access_token,
'Content-Type' => 'application/json',
],
'body' => $json_data,
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/UpdateBearer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static function UpdateBearerWhatsapp($whatsappConfiguration)
{
try {
$client = new Client();
$url = 'https://graph.facebook.com/v18.0/oauth/access_token?grant_type=fb_exchange_token&client_id=' . $whatsappConfiguration->client_id . '&client_secret=' . $whatsappConfiguration->client_secret . '&fb_exchange_token=' . $whatsappConfiguration->access_token;
$url = 'https://graph.facebook.com/v18.0/oauth/access_token?grant_type=fb_exchange_token&client_id='.$whatsappConfiguration->client_id.'&client_secret='.$whatsappConfiguration->client_secret.'&fb_exchange_token='.$whatsappConfiguration->access_token;

$response = $client->request('POST', $url);

Expand Down

0 comments on commit 23cffa3

Please sign in to comment.