Skip to content

Commit d22a66b

Browse files
authored
Merge pull request #1 from coderflexx/setup-resources
Setup Resources
2 parents 6493534 + e09bc66 commit d22a66b

16 files changed

+151
-65
lines changed

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
"require": {
1919
"php": "^8.4",
2020
"spatie/laravel-package-tools": "^1.16",
21-
"illuminate/contracts": "^10.0||^11.0||^12.0"
21+
"illuminate/contracts": "^10.0||^11.0||^12.0",
22+
"ext-curl": "*",
23+
"ext-json": "*",
24+
"league/oauth2-client": "^2",
25+
"guzzlehttp/guzzle": "7.x"
2226
},
2327
"require-dev": {
2428
"laravel/pint": "^1.14",
@@ -71,4 +75,4 @@
7175
},
7276
"minimum-stability": "dev",
7377
"prefer-stable": true
74-
}
78+
}

config/sendy.php

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
<?php
22

3-
// config for Coderflex/LaravelSendy
43
return [
4+
/*
5+
|--------------------------------------------------------------------------
6+
| Sendy Installation URL
7+
|--------------------------------------------------------------------------
8+
|
9+
| This URL is used to connect to your Sendy installation. It should
10+
| point to the root of your Sendy installation. For example:
11+
| https://your-sendy-installation.com
12+
*/
13+
'sendy_installation_url' => env('SENDY_INSTALLATION_URL', 'https://your-sendy-installation.com'),
514

15+
/*
16+
|--------------------------------------------------------------------------
17+
| Sendy API Key
18+
|--------------------------------------------------------------------------
19+
|
20+
| This key is used to authenticate your application with the Sendy
21+
| installation. You can find your API key in the Sendy settings.
22+
| Make sure to keep this key secure and do not share it with anyone.
23+
| It is recommended to use environment variables to store sensitive
24+
| information like API keys. You can set the SENDY_API_KEY
25+
*/
26+
'sendy_api_key' => env('SENDY_API_KEY', 'your-sendy-api-key'),
627
];

database/factories/ModelFactory.php

-19
This file was deleted.

database/migrations/create_sendy_table.php.stub

-19
This file was deleted.

resources/views/.gitkeep

Whitespace-only changes.

src/Commands/LaravelSendyCommand.php

-19
This file was deleted.

src/DTOs/CompaignDTO.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\DTOs;
4+
5+
class CompaignDTO
6+
{
7+
public function __construct(
8+
//
9+
) {}
10+
}

src/DTOs/SubscribersDTO.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\DTOs;
4+
5+
class SubscribersDTO
6+
{
7+
public function __construct(
8+
//
9+
) {}
10+
}

src/Exceptions/CompaingException.php

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\DTOs;
4+
5+
class CompaingException extends \Exception
6+
{
7+
//
8+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\DTOs;
4+
5+
class SubscribersException extends \Exception
6+
{
7+
//
8+
}

src/LaravelSendy.php

+27-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,30 @@
22

33
namespace Coderflex\LaravelSendy;
44

5-
class LaravelSendy {}
5+
use Coderflex\LaravelSendy\Resources\Resources\Brands;
6+
use Coderflex\LaravelSendy\Resources\Resources\Campaigns;
7+
use Coderflex\LaravelSendy\Resources\Resources\Lists;
8+
use Coderflex\LaravelSendy\Resources\Resources\Subscribers;
9+
10+
class LaravelSendy
11+
{
12+
public function subscribers(): Subscribers
13+
{
14+
return new Subscribers;
15+
}
16+
17+
public function lists(): Lists
18+
{
19+
return new Lists;
20+
}
21+
22+
public function brands(): Brands
23+
{
24+
return new Brands;
25+
}
26+
27+
public function campaigns(): Campaigns
28+
{
29+
return new Campaigns;
30+
}
31+
}

src/LaravelSendyServiceProvider.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ public function configurePackage(Package $package): void
1717
*/
1818
$package
1919
->name('laravel-sendy')
20-
->hasConfigFile()
21-
->hasViews()
22-
->hasMigration('create_laravel_sendy_table')
23-
->hasCommand(LaravelSendyCommand::class);
20+
->hasConfigFile();
2421
}
2522
}

src/Resources/Brands.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\Resources\Resources;
4+
5+
class Brands
6+
{
7+
public function get()
8+
{
9+
//
10+
}
11+
}

src/Resources/Campaigns.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\Resources\Resources;
4+
5+
class Campaigns
6+
{
7+
public function create(array $data)
8+
{
9+
//
10+
}
11+
}

src/Resources/Lists.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\Resources\Resources;
4+
5+
class Lists
6+
{
7+
public function get(int $brandId, bool $includeHidden = false)
8+
{
9+
// Implementation to get lists
10+
}
11+
}

src/Resources/Subscribers.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Coderflex\LaravelSendy\Resources\Resources;
4+
5+
class Subscribers
6+
{
7+
public function subscribe(array $data)
8+
{
9+
//
10+
}
11+
12+
public function unsubscribe(int $listId, string $email)
13+
{
14+
//
15+
}
16+
17+
public function delete(int $listId, string $email)
18+
{
19+
//
20+
}
21+
22+
public function count(int $listId)
23+
{
24+
//
25+
}
26+
}

0 commit comments

Comments
 (0)