Skip to content

Commit

Permalink
Update!
Browse files Browse the repository at this point in the history
Update docs to be brand consistent
Tag Laravel 8.0
  • Loading branch information
colinhall17 committed Sep 8, 2020
1 parent 6140cd0 commit 5b97103
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 51 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ composer.lock
docs
vendor
coverage
.phpunit.result.cache
node_modules
.phpunit.result.cache
.idea
/.idea
.php_cs.cache
1 change: 0 additions & 1 deletion .php_cs.cache

This file was deleted.

1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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**!
18 changes: 3 additions & 15 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ The MIT License (MIT)

Copyright (c) Macsi Digital Ltd <[email protected]>

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.
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
![Header Image](https://github.com/MacsiDigital/repo-design/raw/master/laravel-setting/header.png)

<p align="center">
<a href="https://github.com/MacsiDigital/laravel-setting/actions?query=workflow%3Atests"><img src="https://github.com/MacsiDigital/laravel-setting/workflows/Run%20tests/badge.svg" style="max-width:100%;"></a>
<a href="https://packagist.org/packages/macsidigital/laravel-setting"><img src="https://img.shields.io/packagist/v/macsidigital/laravel-setting.svg?style=flat-square"/></a>
<a href="https://packagist.org/packages/macsidigital/laravel-setting"><img src="https://img.shields.io/packagist/dt/macsidigital/laravel-setting.svg?style=flat-square"/></a>
<a href="https://github.com/MacsiDigital/laravel-setting/actions?query=workflow%3Atests"><img src="https://github.com/MacsiDigital/laravel-setting/workflows/Run%20tests/badge.svg" style="max-width:100%;" alt="tests badge"></a>
<a href="https://packagist.org/packages/macsidigital/laravel-setting"><img src="https://img.shields.io/packagist/v/macsidigital/laravel-setting.svg?style=flat-square" alt="version badge"/></a>
<a href="https://packagist.org/packages/macsidigital/laravel-setting"><img src="https://img.shields.io/packagist/dt/macsidigital/laravel-setting.svg?style=flat-square" alt="downloads badge"/></a>
</p>

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

Expand Down Expand Up @@ -42,23 +46,23 @@ $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){
// do something
}
```

## 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([
Expand All @@ -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 [[email protected]](mailto:[email protected]) 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
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
37 changes: 20 additions & 17 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
>
<testsuites>
<testsuite name="Laravel Setting Test">
<directory>tests</directory>
<testsuite name="All Tests">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<php>
<env name="DB_CONNECTION" value="testing" />
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
<server name="MAIL_MAILER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="TELESCOPE_ENABLED" value="false"/>
</php>
</phpunit>

0 comments on commit 5b97103

Please sign in to comment.