Skip to content

Commit

Permalink
Merge branch '2.x'
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json
  • Loading branch information
tomirons committed Feb 26, 2021
2 parents 70f038a + 146b8b4 commit c21ede2
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 47 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor
composer.lock
composer.lock
.phpunit.result.cache
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 Tom Irons
Copyright (c) 2017 Tom Irons

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tomirons/tuxedo",
"description": "Simple transactional email classes/templates for Laravel mailables",
"description": "Simple transactional email classes/templates for Laravel 5.4 mailables",
"license": "MIT",
"authors": [
{
Expand All @@ -9,14 +9,14 @@
}
],
"require": {
"php": ">=7.0",
"illuminate/database": "5.5.*",
"illuminate/mail": "5.5.*",
"illuminate/support": "5.5.*"
"php": "^7.3",
"illuminate/database": "^6.0|^7.0|^8.0",
"illuminate/mail": "^6.0|^7.0|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0"
},
"require-dev": {
"mockery/mockery": "~0.9.4",
"phpunit/phpunit": "~5.7"
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.2"
},
"autoload": {
"psr-4": {
Expand All @@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.x-dev"
},
"laravel": {
"providers": [
Expand Down
17 changes: 7 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
syntaxCheck="true"
verbose="true"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Tuxedo Test Suite">
<directory suffix="Test.php">./tests</directory>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
4 changes: 1 addition & 3 deletions resources/views/html/alert/box.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<td class="alert-content alert-{{ $type }}">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="alert-item">
{{ Illuminate\Mail\Markdown::parse($slot) }}
</td>
<td class="alert-item">{{ Illuminate\Mail\Markdown::parse($slot) }}</td>
</tr>
</table>
</td>
Expand Down
5 changes: 3 additions & 2 deletions resources/views/html/invoice/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<td>
<h3>{{ $data['id'] }}</h3></td>
<td>
<h3 class="align-right">{{ $data['date'] }}</h3></td>
<h3 class="align-right">{{ $data['date'] }}</h3>
</td>
</tr>
<tr>
<td colspan="2">
Expand Down Expand Up @@ -53,4 +54,4 @@
</table>
</td>
</tr>
</table>
</table>
1 change: 0 additions & 1 deletion resources/views/markdown/alert/box.blade.php

This file was deleted.

1 change: 1 addition & 0 deletions resources/views/text/alert/box.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo
5 changes: 2 additions & 3 deletions src/Mailables/ActionMailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

namespace TomIrons\Tuxedo\Mailables;

use TomIrons\Tuxedo\Message;
use TomIrons\Tuxedo\Traits\HasAction;
use TomIrons\Tuxedo\Traits\HasLine;
use TomIrons\Tuxedo\TuxedoMessage;

class ActionMailable extends TuxedoMessage
{
use HasAction,
HasLine;
use HasAction;
use HasLine;

/**
* The Markdown template for the message (if applicable).
Expand Down
1 change: 0 additions & 1 deletion src/Mailables/AlertMailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace TomIrons\Tuxedo\Mailables;

use TomIrons\Tuxedo\Message;
use TomIrons\Tuxedo\Traits\HasLine;
use TomIrons\Tuxedo\TuxedoMessage;

Expand Down
4 changes: 2 additions & 2 deletions src/Mailables/InvoiceMailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

class InvoiceMailable extends TuxedoMessage
{
use HasAction,
HasLine;
use HasAction;
use HasLine;

/**
* The Markdown template for the message (if applicable).
Expand Down
7 changes: 7 additions & 0 deletions src/TuxedoMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

class TuxedoMessage extends Mailable
{
/**
* The theme for the mailable.
*
* @var string
*/
public $theme = 'tuxedo';

/**
* The message's greeting.
*
Expand Down
18 changes: 12 additions & 6 deletions src/TuxedoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace TomIrons\Tuxedo;

use Illuminate\Mail\Markdown;
use Illuminate\Support\ServiceProvider;

class TuxedoServiceProvider extends ServiceProvider
Expand All @@ -16,13 +15,21 @@ public function boot()
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'tuxedo');

$this->alterConfiguration();
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/tuxedo'),
], 'tuxedo');
__DIR__.'/../resources/views' => $this->app->resourcePath('views/vendor/tuxedo'),
], 'tuxedo-mail');
}

$this->alterConfiguration();
}

/**
Expand All @@ -32,7 +39,6 @@ public function boot()
*/
public function alterConfiguration()
{
config()->set('mail.markdown.theme', 'tuxedo');
config()->set('mail.markdown.paths', array_merge([__DIR__.'/../resources/views'], config('mail.markdown.paths')));
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

namespace Tests;
namespace Tests\Unit;

use PHPUnit\Framework\TestCase;
use TomIrons\Tuxedo\Mailables\ActionMailable;

class ActionMailableTest extends \PHPUnit_Framework_TestCase
class ActionMailableTest extends TestCase
{
protected $mailable;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

namespace Tests;
namespace Tests\Unit;

use PHPUnit\Framework\TestCase;
use TomIrons\Tuxedo\Mailables\AlertMailable;

class AlertMailableTest extends \PHPUnit_Framework_TestCase
class AlertMailableTest extends TestCase
{
protected $mailable;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

namespace Tests;
namespace Tests\Unit;

use PHPUnit\Framework\TestCase;
use TomIrons\Tuxedo\Mailables\InvoiceMailable;

class InvoiceMailableTest extends \PHPUnit_Framework_TestCase
class InvoiceMailableTest extends TestCase
{
protected $mailable;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down

0 comments on commit c21ede2

Please sign in to comment.