From 5b971039dadf0733bc9a950200f45d199dadbffb Mon Sep 17 00:00:00 2001 From: Colin Hall Date: Tue, 8 Sep 2020 15:38:39 +0100 Subject: [PATCH] Update! Update docs to be brand consistent Tag Laravel 8.0 --- .gitignore | 4 +++- .php_cs.cache | 1 - .phpunit.result.cache | 1 - CHANGELOG.md | 4 ++++ CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++ LICENSE.md | 18 +++------------- README.md | 39 ++++++++++++++++++++++------------ composer.json | 6 +++--- phpunit.xml.dist | 37 +++++++++++++++++--------------- 9 files changed, 108 insertions(+), 51 deletions(-) delete mode 100644 .php_cs.cache delete mode 100644 .phpunit.result.cache create mode 100644 CONTRIBUTING.md diff --git a/.gitignore b/.gitignore index 10d3e1b..7918384 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ composer.lock docs vendor coverage -.phpunit.result.cache node_modules +.phpunit.result.cache .idea +/.idea +.php_cs.cache diff --git a/.php_cs.cache b/.php_cs.cache deleted file mode 100644 index bd7c15b..0000000 --- a/.php_cs.cache +++ /dev/null @@ -1 +0,0 @@ -{"php":"7.4.7","version":"2.16.4","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":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},"hashes":{"src\/Contracts\/Group.php":1395827216,"src\/Contracts\/Item.php":1127533327,"src\/Models\/Group.php":700255618,"src\/Models\/Item.php":1321282693,"src\/Providers\/SettingServiceProvider.php":1912652597,"src\/Facades\/Group.php":766010511,"src\/Facades\/Item.php":3008255731,"tests\/TestCase.php":2901729371,"tests\/Unit\/SettingTest.php":1667219142}} \ No newline at end of file diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index f808ae3..0000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":787:{a:2:{s:7:"defects";a:5:{s:62:"Setting\Tests\Unit\SettingTest::a_setting_group_can_be_created";i:4;s:64:"Setting\Tests\Unit\SettingTest::a_setting_group_can_have_an_item";i:3;s:61:"Setting\Tests\Unit\SettingTest::a_setting_item_can_be_created";i:4;s:57:"Setting\Tests\Unit\SettingTest::a_group_can_be_autoloaded";i:3;s:57:"Setting\Tests\Unit\SettingTest::an_item_can_be_autoloaded";i:3;}s:5:"times";a:5:{s:62:"Setting\Tests\Unit\SettingTest::a_setting_group_can_be_created";d:12.546;s:64:"Setting\Tests\Unit\SettingTest::a_setting_group_can_have_an_item";d:0.474;s:61:"Setting\Tests\Unit\SettingTest::a_setting_item_can_be_created";d:0.295;s:57:"Setting\Tests\Unit\SettingTest::a_group_can_be_autoloaded";d:0.406;s:57:"Setting\Tests\Unit\SettingTest::an_item_can_be_autoloaded";d:0.223;}}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d67c39d..5750acb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-setting` will be documented in this file +## 1.1.0 - 2020-09-08 + +- Laravel 8.0 + ## 1.0.7 - 2020-04-07 - Models into Models folder diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b6c4c5b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# 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 skill sets, 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/LICENSE.md b/LICENSE.md index 5d28f05..b811ba8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,20 +2,8 @@ The MIT License (MIT) Copyright (c) Macsi Digital Ltd -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 92eae7e..72c41c5 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,16 @@ ![Header Image](https://github.com/MacsiDigital/repo-design/raw/master/laravel-setting/header.png)

- - - + tests badge + version badge + downloads badge

-A setting package to save settings to teh db and access them through config. +A setting package to save settings to the db and access them through config. + +## Support us + +We invest a lot in creating [open source packages](https://macsidigital.co.uk/open-source), and would be grateful for a [sponsor](https://github.com/sponsors/MacsiDigital) if you make money from your product that uses them. ## Installation @@ -42,13 +46,13 @@ $item = Item::make(['key' => 'mailchimp', 'name' => 'Mailchimp Key', 'descriptio $group->items()->save($item); ``` -As we utilise Eloquent you can use any Eloquent functions. For exampledo the following to retreive a setting group +As we utilise Eloquent you can use any Eloquent functions. For example, do the following to retrieve a setting group. ``` php Group::where('identifier', 'membership')->first(); ``` -And we are linked to the items in the normal relationship way +We are linked to the items in the normal relationship way ``` php foreach(Group::where('identifier', 'membership')->first()->items){ @@ -56,9 +60,9 @@ foreach(Group::where('identifier', 'membership')->first()->items){ } ``` -## Autoloading +## Auto loading -There is also an autoload field which if set will automatically load the settings into config +There's an autoload field, which if set will automatically load the settings into config ``` php $group = Group::create([ @@ -74,21 +78,30 @@ $group->items()->save($item); config('test.mailchimp.api'); ``` -These will be automatically loaded when the Setting Service Provider is run. +This will be automatically loaded when the Setting Service Provider is booted. -### Testing +## Testing ``` bash -phpunit +composer test ``` -### Changelog +## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. +## Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md) for details. + +## Security + +If you discover any security-related issues, please email [info@macsi.co.uk](mailto:info@masi.co.uk) instead of using the issue tracker. + ## Credits -- [Colin Hall](https://github.com/colinhall17) +- [Colin Hall](https://github.com/ColinHall) +- [MacsiDigital](https://github.com/MacsiDigital) - [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index adacab8..4c1236b 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,12 @@ } ], "require": { - "php": "^7.2", - "illuminate/support": "^6.0|^7.0" + "php": "^7.3", + "illuminate/support": "^6.0|^7.0|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.16", - "orchestra/testbench": "^4.0|^5.0", + "orchestra/testbench": "^4.0|^5.0|^6.0", "phpunit/phpunit": "^8.0|^9.0", "psalm/plugin-laravel": "^1.2", "vimeo/psalm": "^3.11" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3a71635..fb70d20 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,28 @@ - +> - - tests + + ./tests - - - src/ - - + + + ./src + + - + + + + + + + + +