Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
thannaske committed Jan 17, 2022
1 parent db100ef commit 9632e94
Show file tree
Hide file tree
Showing 26 changed files with 285 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: :vendor_name
github: rescaled
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/:vendor_name/:package_name/discussions/new?category=q-a
url: https://github.com/rescaled/simple-feature/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
url: https://github.com/rescaled/simple-feature/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/:vendor_name/:package_name/security/policy
url: https://github.com/rescaled/simple-feature/security/policy
about: Learn how to notify us for sensitive bugs
- name: Report a bug
url: https://github.com/:vendor_name/:package_name/issues/new
url: https://github.com/rescaled/simple-feature/issues/new
about: Report a reproducable bug
3 changes: 0 additions & 3 deletions .github/SECURITY.md

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

All notable changes to `:package_name` will be documented in this file.
All notable changes to `simple-feature` will be documented in this file.

## 1.0.0 - 202X-XX-XX
## 1.0.0 - 2022-01-17

- initial release
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) :vendor_name <[email protected]>
Copyright (c) rescaled GmbH <[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
Expand Down
74 changes: 22 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,38 @@
# :package_description
# Simple Feature

[![Latest Version on Packagist](https://img.shields.io/packagist/v/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/run-tests?label=tests)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/:vendor_slug/:package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
<!--delete-->
---
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
[![Latest Version on Packagist](https://img.shields.io/packagist/v/rescaled/simple-feature.svg?style=flat-square)](https://packagist.org/packages/rescaled/simple-feature)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/rescaled/simple-feature/run-tests?label=tests)](https://github.com/rescaled/simple-feature/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/rescaled/simple-feature/Check%20&%20fix%20styling?label=code%20style)](https://github.com/rescaled/simple-feature/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/rescaled/simple-feature.svg?style=flat-square)](https://packagist.org/packages/rescaled/simple-feature)

1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
3. Have fun creating your package.
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
---
<!--/delete-->
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

## Support us

[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)

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).
Simple Feature allows you to define feature flags via environment variables and check for their state within
your Laravel application. It also provides pre-defined middleware you can utilize for this use case.

## Installation

You can install the package via composer:

```bash
composer require :vendor_slug/:package_slug
```

You can publish and run the migrations with:

```bash
php artisan vendor:publish --tag=":package_slug-migrations"
php artisan migrate
composer require rescaled/simple-feature
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag=":package_slug-config"
```

This is the contents of the published config file:

```php
return [
];
```
## Usage

Optionally, you can publish the views using
```dotenv
FEATURE_FIRST_TEST=true
FEATURE_SECOND_TEST=true
```bash
php artisan vendor:publish --tag=":package_slug-views"
FEATURE_THIRD_TEST=false
FEATURE_FOURTH_TEST=false
```

## Usage

```php
$variable = new VendorName\Skeleton();
echo $variable->echoPhrase('Hello, VendorName!');
SimpleFeature::enabled('firstTest') // true
SimpleFeature::disabled('firstTest') // false
SimpleFeature::allEnabled(['firstTest', 'secondTest']) // true
SimpleFeature::allDisabled(['thirdTest', 'fourthTest']) // true
SimpleFeature::allEnabled(['firstTest', 'thirdTest']) // false
SimpleFeature::allDisabled(['firstTest', 'thirdTest']) // false
```

## Testing
Expand All @@ -81,11 +51,11 @@ Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
Please report security vulnerabilities directly to the maintainer. You can find contact information on their GitHub profile.

## Credits

- [:author_name](https://github.com/:author_username)
- [Tobias Hannaske](https://github.com/thannaske)
- [All Contributors](../../contributors)

## License
Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": ":vendor_slug/:package_slug",
"description": ":package_description",
"name": "rescaled/simple-feature",
"description": "This package aims to provide a fully-featured, yet simple feature flag configuration through environment variables for Laravel 7+",
"keywords": [
":vendor_name",
"rescaled",
"laravel",
":package_slug"
"simple-feature"
],
"homepage": "https://github.com/:vendor_slug/:package_slug",
"homepage": "https://github.com/rescaled/simple-feature",
"license": "MIT",
"authors": [
{
"name": ":author_name",
"email": "[email protected]",
"name": "Tobias Hannaske",
"email": "[email protected]",
"role": "Developer"
}
],
Expand All @@ -29,18 +29,17 @@
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"spatie/laravel-ray": "^1.26"
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
"VendorName\\Skeleton\\": "src",
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories"
"Rescaled\\SimpleFeature\\": "src",
"Rescaled\\SimpleFeature\\Database\\Factories\\": "database/factories"
}
},
"autoload-dev": {
"psr-4": {
"VendorName\\Skeleton\\Tests\\": "tests"
"Rescaled\\SimpleFeature\\Tests\\": "tests"
}
},
"scripts": {
Expand All @@ -54,10 +53,10 @@
"extra": {
"laravel": {
"providers": [
"VendorName\\Skeleton\\SkeletonServiceProvider"
"Rescaled\\SimpleFeature\\SimpleFeatureServiceProvider"
],
"aliases": {
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
"SimpleFeature": "Rescaled\\SimpleFeature\\Facades\\SimpleFeature"
}
}
},
Expand Down
5 changes: 0 additions & 5 deletions config/skeleton.php

This file was deleted.

Loading

0 comments on commit 9632e94

Please sign in to comment.