From 3e9dd50354951b0032738e41ec2b6b7843ce67ea Mon Sep 17 00:00:00 2001 From: wulfheart Date: Sat, 6 Feb 2021 23:41:01 +0100 Subject: [PATCH] Working --- .github/CONTRIBUTING.md | 55 ----------- .github/FUNDING.yml | 1 - .github/ISSUE_TEMPLATE/config.yml | 11 --- .github/SECURITY.md | 3 - .github/workflows/php-cs-fixer.yml | 23 ----- .github/workflows/psalm.yml | 33 ------- .github/workflows/run-tests.yml | 43 -------- .php_cs.dist | 43 -------- CHANGELOG.md | 2 +- LICENSE.md | 2 +- README.md | 70 ++++--------- composer.json | 28 +++--- config/skeleton.php | 5 - configure-skeleton.sh | 93 ------------------ database/factories/ModelFactory.php | 19 ---- .../migrations/create_skeleton_table.php.stub | 19 ---- img/screen.mp4 | Bin 0 -> 121495 bytes img/screen.webm | Bin 0 -> 760996 bytes img/video.gif | Bin 0 -> 138184 bytes phpunit.xml.dist | 31 ------ psalm.xml.dist | 16 --- resources/views/.gitkeep | 0 src/Commands/SkeletonCommand.php | 17 ---- src/LaravelMailto.php | 68 +++++++++++++ src/LaravelMailtoFacade.php | 16 +++ src/LaravelMailtoServiceProvider.php | 31 ++++++ src/Skeleton.php | 7 -- src/SkeletonFacade.php | 16 --- src/SkeletonServiceProvider.php | 25 ----- src/helper.php | 12 +++ tests/ExampleTest.php | 2 +- tests/TestCase.php | 10 +- 32 files changed, 168 insertions(+), 533 deletions(-) delete mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/SECURITY.md delete mode 100644 .github/workflows/php-cs-fixer.yml delete mode 100644 .github/workflows/psalm.yml delete mode 100644 .github/workflows/run-tests.yml delete mode 100644 .php_cs.dist delete mode 100644 config/skeleton.php delete mode 100755 configure-skeleton.sh delete mode 100644 database/factories/ModelFactory.php delete mode 100644 database/migrations/create_skeleton_table.php.stub create mode 100644 img/screen.mp4 create mode 100644 img/screen.webm create mode 100644 img/video.gif delete mode 100644 phpunit.xml.dist delete mode 100644 psalm.xml.dist delete mode 100644 resources/views/.gitkeep delete mode 100644 src/Commands/SkeletonCommand.php create mode 100644 src/LaravelMailto.php create mode 100644 src/LaravelMailtoFacade.php create mode 100644 src/LaravelMailtoServiceProvider.php delete mode 100755 src/Skeleton.php delete mode 100644 src/SkeletonFacade.php delete mode 100644 src/SkeletonServiceProvider.php create mode 100644 src/helper.php diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index b4ae1c4..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,55 +0,0 @@ -# Contributing - -Contributions are **welcome** and will be fully **credited**. - -Please read and understand the contribution guide before creating an issue or pull request. - -## Etiquette - -This project is open source, and as such, the maintainers give their free time to build and maintain the source code -held within. They make the code freely available in the hope that it will be of use to other developers. It would be -extremely unfair for them to suffer abuse or anger for their hard work. - -Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the -world that developers are civilized and selfless people. - -It's the duty of the maintainer to ensure that all submissions to the project are of sufficient -quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. - -## Viability - -When requesting or submitting new features, first consider whether it might be useful to others. Open -source projects are used by many developers, who may have entirely different needs to your own. Think about -whether or not your feature is likely to be used by other users of the project. - -## Procedure - -Before filing an issue: - -- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. -- Check to make sure your feature suggestion isn't already present within the project. -- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. -- Check the pull requests tab to ensure that the feature isn't already in progress. - -Before submitting a pull request: - -- Check the codebase to ensure that your feature doesn't already exist. -- Check the pull requests to ensure that another person hasn't already submitted the feature or fix. - -## Requirements - -If the project maintainer has any additional requirements, you will find them listed here. - -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). - -- **Add tests!** - Your patch won't be accepted if it doesn't have tests. - -- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. - -- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. - -- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. - -**Happy coding**! diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index c68765b..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: :vendor_name diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index aeef948..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Ask a question - url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a - about: Ask the community for help - - name: Request a feature - url: https://github.com/:vendor_name/:package_name/discussions/new?category=ideas - about: Share ideas for new features - - name: Report a bug - url: https://github.com/:vendor_name/:package_name/issues/new - about: Report a reproducable bug diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 3d41ffb..0000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,3 +0,0 @@ -# Security Policy - -If you discover any security related issues, please email :author_email instead of using the issue tracker. diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml deleted file mode 100644 index 4cf285f..0000000 --- a/.github/workflows/php-cs-fixer.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Check & fix styling - -on: [push] - -jobs: - php-cs-fixer: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - - name: Run PHP CS Fixer - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --config=.php_cs.dist --allow-risky=yes - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Fix styling diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml deleted file mode 100644 index 99cf0d9..0000000 --- a/.github/workflows/psalm.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Psalm - -on: - push: - paths: - - '**.php' - - 'psalm.xml.dist' - -jobs: - psalm: - name: psalm - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick - coverage: none - - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: vendor - key: composer-${{ hashFiles('composer.lock') }} - - - name: Run composer install - run: composer install -n --prefer-dist - - - name: Run psalm - run: ./vendor/bin/psalm --output-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml deleted file mode 100644 index 1728d74..0000000 --- a/.github/workflows/run-tests.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Tests - -on: [push, pull_request] - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest, windows-latest] - php: [8.0, 7.4] - laravel: [8.*] - stability: [prefer-lowest, prefer-stable] - include: - - laravel: 8.* - testbench: 6.* - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo - coverage: none - - - name: Setup problem matchers - run: | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.stability }} --prefer-dist --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index c7d380c..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,43 +0,0 @@ -notPath('bootstrap/*') - ->notPath('storage/*') - ->notPath('resources/view/mail/*') - ->in([ - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->notName('*.blade.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return PhpCsFixer\Config::create() - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, - 'phpdoc_scalar' => true, - 'unary_operator_spaces' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method', - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - ]) - ->setFinder($finder); diff --git a/CHANGELOG.md b/CHANGELOG.md index 767365d..aafdc3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to `:package_name` will be documented in this file. +All notable changes to `laravel-mailto` will be documented in this file. ## 1.0.0 - 202X-XX-XX diff --git a/LICENSE.md b/LICENSE.md index d76fbb6..7e7fe2f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) :vendor_name <:author_email> +Copyright (c) wulfheart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index f1f6429..51f8de7 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,46 @@ -# :package_description +# Laravel-Mailto -[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_name/:package_name.svg?style=flat-square)](https://packagist.org/packages/:vendor_name/:package_name) -[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_name/:package_name/run-tests?label=tests)](https://github.com/:vendor_name/:package_name/actions?query=workflow%3ATests+branch%3Amaster) -[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_name/:package_name.svg?style=flat-square)](https://packagist.org/packages/:vendor_name/:package_name) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/wulfheart/laravel-mailto.svg?style=flat-square)](https://packagist.org/packages/wulfheart/laravel-mailto) +[![Total Downloads](https://img.shields.io/packagist/dt/wulfheart/laravel-mailto.svg?style=flat-square)](https://packagist.org/packages/wulfheart/laravel-mailto) -**Note:** Run `./configure-skeleton` to get started, or manually replace ```:author_name``` ```:author_username``` ```:author_email``` ```:vendor_name``` ```:package_name``` ```:package_description``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](.github/CONTRIBUTING.md), [LICENSE.md](LICENSE.md) and [composer.json](composer.json) files, then delete this line. You can also run `configure-skeleton.sh` to do this automatically. -This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. +Laravel-Mailto allows you to generate mailto-links with recipients, cc and bcc, subject and body. If an user clicks the link it opens the default mail editor prefilled with data. -## Support us - -[](https://spatie.be/github-ad-click/package-skeleton-laravel) - -We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). - -We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). ## Installation You can install the package via composer: ```bash -composer require :vendor_name/:package_name -``` - -You can publish and run the migrations with: - -```bash -php artisan vendor:publish --provider="Spatie\Skeleton\SkeletonServiceProvider" --tag=":package_name-migrations" -php artisan migrate -``` - -You can publish the config file with: -```bash -php artisan vendor:publish --provider="Spatie\Skeleton\SkeletonServiceProvider" --tag=":package_name-config" -``` - -This is the contents of the published config file: - -```php -return [ -]; +composer require wulfheart/laravel-mailto ``` ## Usage -```php -$skeleton = new Spatie\Skeleton(); -echo $skeleton->echoPhrase('Hello, Spatie!'); +```blade +// some blade file +cc(["ryan@example.com", "taylor@example.com"]) +->bcc("freek@example.com") +->subject("Laravel") +->body("Hello Jeffrey,\n\nthis is a message.\n\nBest,\nAlex") +}}"> + Send mail 📧 + ``` -## Testing +## Result -```bash -composer test -``` - -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. +![Result](./img/video.gif) ## Contributing -Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. - -## Security Vulnerabilities - -Please review [our security policy](../../security/policy) on how to report security vulnerabilities. +You are welcome to contribute. ## Credits -- [:author_name](https://github.com/:author_username) +- [Alex Wulf](https://github.com/wulfheart) - [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index 3917d41..86c9447 100644 --- a/composer.json +++ b/composer.json @@ -1,43 +1,41 @@ { - "name": ":vendor_name/:package_name", - "description": ":package_description", + "name": "wulfheart/laravel-mailto", + "description": "laravel-mailto", "keywords": [ - ":vendor_name", - ":package_name" + "wulfheart", + "laravel-mailto" ], - "homepage": "https://github.com/:vendor_name/:package_name", + "homepage": "https://github.com/wulfheart/laravel-mailto", "license": "MIT", "authors": [ { - "name": ":author_name", - "email": ":author_email", + "name": "Alex Wulf", + "email": "dev@alexfwulf.de", "role": "Developer" } ], "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "spatie/laravel-package-tools": "^1.1", "illuminate/contracts": "^8.0" }, "require-dev": { "orchestra/testbench": "^6.0", "phpunit/phpunit": "^9.3", - "spatie/laravel-ray": "^1.9", "vimeo/psalm": "^4.4" }, "autoload": { "psr-4": { - "Spatie\\Skeleton\\": "src", - "Spatie\\Skeleton\\Database\\Factories\\": "database/factories" + "Wulfheart\\LaravelMailto\\": "src", + "Wulfheart\\LaravelMailto\\Database\\Factories\\": "database/factories" } }, "autoload-dev": { "psr-4": { - "Spatie\\Skeleton\\Tests\\": "tests" + "Wulfheart\\LaravelMailto\\Tests\\": "tests" } }, "scripts": { - "psalm": "vendor/bin/psalm", "test": "vendor/bin/phpunit --colors=always", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" }, @@ -47,10 +45,10 @@ "extra": { "laravel": { "providers": [ - "Spatie\\Skeleton\\SkeletonServiceProvider" + "Wulfheart\\LaravelMailto\\LaravelMailtoServiceProvider" ], "aliases": { - "Skeleton": "Spatie\\Skeleton\\SkeletonFacade" + "LaravelMailto": "Wulfheart\\LaravelMailto\\LaravelMailtoFacade" } } }, diff --git a/config/skeleton.php b/config/skeleton.php deleted file mode 100644 index ca5d8ed..0000000 --- a/config/skeleton.php +++ /dev/null @@ -1,5 +0,0 @@ -" or ".