Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Malebestia committed Sep 4, 2023
1 parent 79b8a53 commit 0e7bd06
Show file tree
Hide file tree
Showing 14 changed files with 208 additions and 182 deletions.
36 changes: 31 additions & 5 deletions Actions/NetfunSendAction.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<?php

<<<<<<< HEAD
<<<<<<< HEAD
declare(strict_types=1);

=======
>>>>>>> 48d3f55 (up)
=======
declare(strict_types=1);

>>>>>>> bc60653 (up)
namespace Modules\Notify\Actions;

use Exception;
use GuzzleHttp\Client;
<<<<<<< HEAD
<<<<<<< HEAD
use GuzzleHttp\Exception\ClientException;
use Illuminate\Support\Str;
use Modules\Notify\Datas\SmsData;
Expand All @@ -18,9 +24,11 @@
class NetfunSendAction
{
=======
=======
use GuzzleHttp\Exception\ClientException;
>>>>>>> bc60653 (up)
use Illuminate\Support\Str;
use Modules\Notify\Data\SmsData;
use GuzzleHttp\Exception\ClientException;
use Spatie\QueueableAction\QueueableAction;

class NetfunSendAction {
Expand All @@ -29,12 +37,17 @@ class NetfunSendAction {

public string $token;

<<<<<<< HEAD
<<<<<<< HEAD
public array $vars = [];

=======
public array $vars=[];
>>>>>>> 48d3f55 (up)
=======
public array $vars = [];

>>>>>>> bc60653 (up)
/**
* Create a new action instance.
*
Expand All @@ -59,14 +72,14 @@ public function execute(SmsData $sms): array
=======
public function __construct() {
// Prepare the action for execution, leveraging constructor injection.
$token=config('services.netfun.token');
if($token==null){
$token = config('services.netfun.token');
if (null == $token) {
throw new Exception('put [NETFUN_TOKEN] variable to your .env and config [services.netfun.token] ');
}
$this->token=$token;
$this->token = $token;
}

/**
/**
* Execute the action.
*/
public function execute(SmsData $sms): array {
Expand All @@ -76,6 +89,7 @@ public function execute(SmsData $sms): array {
'Cache-Control' => 'no-cache',
'Content-Type' => 'application/json',
];
<<<<<<< HEAD
<<<<<<< HEAD

// dddx([ord($this->body[0]), $this->body]);
Expand All @@ -89,6 +103,8 @@ public function execute(SmsData $sms): array {
$sms->to = '+39' . $sms->to;
=======

=======
>>>>>>> bc60653 (up)

// dddx([ord($this->body[0]), $this->body]);

Expand All @@ -106,11 +122,15 @@ public function execute(SmsData $sms): array {
'api_token' => $this->token,
// "gateway"=> 99,
'sender' => $sms->from,
<<<<<<< HEAD
<<<<<<< HEAD
'text_template' => $sms->body, // .' '.rand(1, 100),
=======
'text_template' => $sms->body,//.' '.rand(1, 100),
>>>>>>> 48d3f55 (up)
=======
'text_template' => $sms->body, // .' '.rand(1, 100),
>>>>>>> bc60653 (up)
/*
'delivery_callback' => 'https://www.google.com?code={{code}}',
'default_placeholders' => [
Expand Down Expand Up @@ -157,12 +177,18 @@ public function execute(SmsData $sms): array {
$this->vars['status_code'] = $response->getStatusCode();
$this->vars['status_txt'] = $response->getBody()->getContents();
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> bc60653 (up)

return $this->vars;
}
}
<<<<<<< HEAD
=======
return $this->vars;
}
}
>>>>>>> 48d3f55 (up)
=======
>>>>>>> bc60653 (up)
31 changes: 21 additions & 10 deletions Config/beautymail.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

<<<<<<< HEAD
<<<<<<< HEAD
declare(strict_types=1);

Expand All @@ -8,6 +9,11 @@
return [

>>>>>>> 64529a0 (up)
=======
declare(strict_types=1);

return [
>>>>>>> bc60653 (up)
// These CSS rules will be applied after the regular template CSS

/*
Expand All @@ -17,6 +23,7 @@
*/

'colors' => [
<<<<<<< HEAD
<<<<<<< HEAD
'highlight' => '#004ca3',
'button' => '#004cad',
Expand All @@ -40,27 +47,31 @@
],
=======

=======
>>>>>>> bc60653 (up)
'highlight' => '#004ca3',
'button' => '#004cad',

'button' => '#004cad',
],

'view' => [
'senderName' => null,
'reminder' => null,
'senderName' => null,
'reminder' => null,
'unsubscribe' => null,
'address' => null,
'address' => null,

'logo' => [
'path' => '%PUBLIC%/vendor/beautymail/assets/images/sunny/logo.png',
'width' => '',
'logo' => [
'path' => '%PUBLIC%/vendor/beautymail/assets/images/sunny/logo.png',
'width' => '',
'height' => '',
],

'twitter' => null,
'twitter' => null,
'facebook' => null,
'flickr' => null,
'flickr' => null,
],
<<<<<<< HEAD

>>>>>>> 64529a0 (up)
=======
>>>>>>> bc60653 (up)
];
6 changes: 3 additions & 3 deletions Data/SmsData.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

namespace Modules\Notify\Data;

use Spatie\LaravelData\Data;

class SmsData extends Data {

public string $from;
public string $to;
public string $body;

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

<<<<<<< HEAD
<<<<<<< HEAD
// https://blog.quickadminpanel.com/laravel-notifications-with-database-driver-internal-messages/
declare(strict_types=1);
Expand All @@ -11,19 +12,25 @@ class CreateNotificationsTable extends XotBaseMigration
{
=======
use Illuminate\Support\Facades\Schema;
=======
declare(strict_types=1);

>>>>>>> bc60653 (up)
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Modules\Xot\Database\Migrations\XotBaseMigration;


class CreateNotificationsTable extends XotBaseMigration {
<<<<<<< HEAD

>>>>>>> 40ebae8 (up)
=======
>>>>>>> bc60653 (up)
/**
* Run the migrations.
*
* @return void
*/
<<<<<<< HEAD
<<<<<<< HEAD
public function up()
{
Expand All @@ -32,6 +39,10 @@ public function up()
public function up(){
// -- CREATE --
>>>>>>> 40ebae8 (up)
=======
public function up() {
// -- CREATE --
>>>>>>> bc60653 (up)
$this->tableCreate(
function (Blueprint $table) {
$table->uuid('id')->primary();
Expand All @@ -42,11 +53,15 @@ function (Blueprint $table) {
$table->timestamps();
}
);
<<<<<<< HEAD
<<<<<<< HEAD
// -- UPDATE --
=======
// -- UPDATE --
>>>>>>> 40ebae8 (up)
=======
// -- UPDATE --
>>>>>>> bc60653 (up)
$this->tableUpdate(
function (Blueprint $table) {
if (! $this->hasColumn('updated_at')) {
Expand All @@ -60,9 +75,13 @@ function (Blueprint $table) {
);
}
<<<<<<< HEAD
<<<<<<< HEAD
}
=======


};
>>>>>>> 40ebae8 (up)
=======
}
>>>>>>> bc60653 (up)
Loading

0 comments on commit 0e7bd06

Please sign in to comment.