Skip to content

Setup Resources #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"require": {
"php": "^8.4",
"spatie/laravel-package-tools": "^1.16",
"illuminate/contracts": "^10.0||^11.0||^12.0"
"illuminate/contracts": "^10.0||^11.0||^12.0",
"ext-curl": "*",
"ext-json": "*",
"league/oauth2-client": "^2",
"guzzlehttp/guzzle": "7.x"
},
"require-dev": {
"laravel/pint": "^1.14",
Expand Down Expand Up @@ -71,4 +75,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
23 changes: 22 additions & 1 deletion config/sendy.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
<?php

// config for Coderflex/LaravelSendy
return [
/*
|--------------------------------------------------------------------------
| Sendy Installation URL
|--------------------------------------------------------------------------
|
| This URL is used to connect to your Sendy installation. It should
| point to the root of your Sendy installation. For example:
| https://your-sendy-installation.com
*/
'sendy_installation_url' => env('SENDY_INSTALLATION_URL', 'https://your-sendy-installation.com'),

/*
|--------------------------------------------------------------------------
| Sendy API Key
|--------------------------------------------------------------------------
|
| This key is used to authenticate your application with the Sendy
| installation. You can find your API key in the Sendy settings.
| Make sure to keep this key secure and do not share it with anyone.
| It is recommended to use environment variables to store sensitive
| information like API keys. You can set the SENDY_API_KEY
*/
'sendy_api_key' => env('SENDY_API_KEY', 'your-sendy-api-key'),
];
19 changes: 0 additions & 19 deletions database/factories/ModelFactory.php

This file was deleted.

19 changes: 0 additions & 19 deletions database/migrations/create_sendy_table.php.stub

This file was deleted.

Empty file removed resources/views/.gitkeep
Empty file.
19 changes: 0 additions & 19 deletions src/Commands/LaravelSendyCommand.php

This file was deleted.

10 changes: 10 additions & 0 deletions src/DTOs/CompaignDTO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Coderflex\LaravelSendy\DTOs;

class CompaignDTO
{
public function __construct(
//
) {}
}
10 changes: 10 additions & 0 deletions src/DTOs/SubscribersDTO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Coderflex\LaravelSendy\DTOs;

class SubscribersDTO
{
public function __construct(
//
) {}
}
8 changes: 8 additions & 0 deletions src/Exceptions/CompaingException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Coderflex\LaravelSendy\DTOs;

class CompaingException extends \Exception
{
//
}
8 changes: 8 additions & 0 deletions src/Exceptions/SubscribersException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Coderflex\LaravelSendy\DTOs;

class SubscribersException extends \Exception
{
//
}
28 changes: 27 additions & 1 deletion src/LaravelSendy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,30 @@

namespace Coderflex\LaravelSendy;

class LaravelSendy {}
use Coderflex\LaravelSendy\Resources\Resources\Brands;
use Coderflex\LaravelSendy\Resources\Resources\Campaigns;
use Coderflex\LaravelSendy\Resources\Resources\Lists;
use Coderflex\LaravelSendy\Resources\Resources\Subscribers;

class LaravelSendy
{
public function subscribers(): Subscribers
{
return new Subscribers;
}

public function lists(): Lists
{
return new Lists;
}

public function brands(): Brands
{
return new Brands;
}

public function campaigns(): Campaigns
{
return new Campaigns;
}
}
6 changes: 1 addition & 5 deletions src/LaravelSendyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Coderflex\LaravelSendy\Commands\LaravelSendyCommand;

class LaravelSendyServiceProvider extends PackageServiceProvider
{
Expand All @@ -17,9 +16,6 @@ public function configurePackage(Package $package): void
*/
$package
->name('laravel-sendy')
->hasConfigFile()
->hasViews()
->hasMigration('create_laravel_sendy_table')
->hasCommand(LaravelSendyCommand::class);
->hasConfigFile();
}
}
11 changes: 11 additions & 0 deletions src/Resources/Brands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Coderflex\LaravelSendy\Resources\Resources;

class Brands
{
public function get()
{
//
}
}
11 changes: 11 additions & 0 deletions src/Resources/Campaigns.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Coderflex\LaravelSendy\Resources\Resources;

class Campaigns
{
public function create(array $data)
{
//
}
}
11 changes: 11 additions & 0 deletions src/Resources/Lists.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Coderflex\LaravelSendy\Resources\Resources;

class Lists
{
public function get(int $brandId, bool $includeHidden = false)
{
// Implementation to get lists
}
}
26 changes: 26 additions & 0 deletions src/Resources/Subscribers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Coderflex\LaravelSendy\Resources\Resources;

class Subscribers
{
public function subscribe(array $data)
{
//
}

public function unsubscribe(int $listId, string $email)
{
//
}

public function delete(int $listId, string $email)
{
//
}

public function count(int $listId)
{
//
}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Coderflex\LaravelSendy\Tests;

use Coderflex\LaravelSendy\LaravelSendyServiceProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
use Orchestra\Testbench\TestCase as Orchestra;
use Coderflex\LaravelSendy\LaravelSendyServiceProvider;

class TestCase extends Orchestra
{
Expand Down
Loading