Skip to content

Commit 6f113d3

Browse files
committed
Initial Commit
0 parents  commit 6f113d3

12 files changed

+478
-0
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea
2+
.phpunit.cache
3+
build
4+
composer.lock
5+
coverage
6+
docs
7+
phpunit.xml
8+
phpstan.neon
9+
testbench.yaml
10+
vendor
11+
node_modules

CHANGELOG.md

Whitespace-only changes.

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Contributing
2+
I'm currently still paving the way. I'll start accepting contributions from v1.1. Thanks

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 RingleSoft ([email protected])
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Laravel Selectable
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/ringlesoft/laravel-selectable.svg?style=flat-square)](https://packagist.org/packages/ringlesoft/laravel-selectable)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ringlesoft/laravel-selectable/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/ringlesoft/laravel-selectable/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/ringlesoft/laravel-selectable/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/ringlesoft/laravel-selectable/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/ringlesoft/laravel-selectable.svg?style=flat-square)](https://packagist.org/packages/ringlesoft/laravel-selectable)
7+
<!--delete-->
8+
---
9+
A laravel package for generating HTML select options from laravel collections. You do not need to add any trait or extend any class.
10+
11+
## Installation
12+
13+
You can install the package via composer:
14+
15+
```bash
16+
composer require ringlesoft/laravel-selectable
17+
```
18+
19+
You can publish the config file with:
20+
21+
```bash
22+
php artisan vendor:publish --tag="laravel-selectable-config"
23+
```
24+
25+
This is the contents of the published config file:
26+
27+
```php
28+
return [
29+
"css_library" => "tailwind",
30+
];
31+
```
32+
33+
Optionally, you can publish the views using
34+
35+
```bash
36+
php artisan vendor:publish --tag="laravel-selectable-views"
37+
```
38+
39+
## Usage
40+
41+
### 1. Basic Usage
42+
```html
43+
<select name="user_id" >
44+
{!! \\App\\Model\\User::all()->toSelectOptions(); !!}}
45+
</select>
46+
```
47+
The output for this code will be as follows
48+
49+
```html
50+
<option value="{{$user->id}}">{{$user->name}}</option>
51+
...
52+
```
53+
54+
### 2. Custom text and value for options
55+
```html
56+
<select name="user_id" >
57+
{!! \\App\\Model\\User::all()->toSelectOptions('email', 'uuid'); !!}}
58+
</select>
59+
```
60+
The output for this code will be as follows
61+
62+
```html
63+
<option value="{{$user->uuid}}">{{$user->email}}</option>
64+
...
65+
```
66+
67+
> <small><strong>Note:</strong> Writing queries within blade templates is not recommended. This is only for simplifying demonstration</small>
68+
69+
## Testing
70+
71+
```bash
72+
composer test
73+
```
74+
75+
## Changelog
76+
77+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
78+
79+
## Contributing
80+
81+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
82+
83+
## Security Vulnerabilities
84+
85+
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
86+
87+
## Credits
88+
89+
- [David Ringle](https://github.com/ringunger)
90+
- [All Contributors](../../contributors)
91+
92+
## License
93+
94+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

SECURITY.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The following versions of laravel process approval package are
6+
currently being supported with security updates.
7+
8+
| Version | Supported |
9+
|---------|--------------------|
10+
| 1.0.x | :white_check_mark: |
11+
12+
## Reporting a Vulnerability
13+
14+
We take the security of the Laravel Process Approval package seriously. If you have discovered a vulnerability, we appreciate your assistance in disclosing it responsibly. This ensures that we can address and resolve the issue promptly to maintain the security of our users.
15+
16+
### Reporting Process
17+
To report a vulnerability, please follow these steps:
18+
19+
- **Email**: Send an email to [email protected] with the subject "Security Vulnerability Report."
20+
21+
- **Include Details**: In your email, provide detailed information about the vulnerability. Include steps to reproduce the issue, potential impact, and any other relevant details that can help us understand and address the problem.
22+
23+
- **Contact Information**: Include your contact information, including your name and any preferred method of communication (email, phone, etc.).
24+
25+
- **Encryption**: If the vulnerability details are sensitive, you can use our PGP key for encryption. Contact us via email to request the PGP key.
26+
27+
### Response Time
28+
We strive to acknowledge all vulnerability reports promptly. Our team will review the report, and you can expect an initial response within 48 hours.
29+
30+
### Vulnerability Handling
31+
#### Accepted Vulnerabilities
32+
If the reported vulnerability is accepted, we will work on a fix and release a new version of the Laravel Process Approval package. We will credit you for the responsible disclosure unless you prefer to remain anonymous.
33+
34+
#### Declined Vulnerabilities
35+
If the reported vulnerability is deemed not to be a valid issue, we will provide a detailed explanation of our findings. You can appeal our decision if you believe there has been a misunderstanding.
36+
37+
### Confidentiality
38+
We understand the sensitivity of security-related information. We will handle all reports with the utmost confidentiality. Please let us know if there are specific concerns or limitations regarding the disclosure of the vulnerability.
39+
40+
### Responsible Disclosure
41+
We appreciate your responsible disclosure of security vulnerabilities. We encourage you to avoid publicizing the vulnerability until we have had an opportunity to address it. We will keep you informed of the progress and coordinate the public disclosure timeline.
42+
43+
Thank you for helping us keep Laravel Process Approval secure for everyone. Your efforts contribute to the safety and well-being of our user community.

composer.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "ringlesoft/laravel-selectable",
3+
"description": "",
4+
"type": "laravel-package",A package to populate select options from laravel collections.
5+
"homepage": "https://ringlesoft.com/packages/laravel-selectable",
6+
"license": "MIT",
7+
"keywords": [
8+
"ringlesoft",
9+
"selectable",
10+
"collection",
11+
"select-options",
12+
"options",
13+
"laravel"
14+
],
15+
"autoload": {
16+
"psr-4": {
17+
"RingleSoft\\LaravelSelectable\\": "src/"
18+
}
19+
},
20+
"authors": [
21+
{
22+
"name": "David Ringle",
23+
"email": "[email protected]",
24+
"homepage": "https://ringlesoft.com",
25+
"role": "Developer"
26+
}
27+
],
28+
"require": {
29+
"php": ">=8.1",
30+
"illuminate/collections": "^9.0|^10.0|^11.0",
31+
"illuminate/routing": "^9.0|^10.24|^11.0"
32+
}
33+
,
34+
"require-dev": {
35+
"roave/security-advisories": "dev-latest"
36+
},
37+
"extra": {
38+
"laravel": {
39+
"providers": [
40+
"RingleSoft\\LaravelSelectable\\LaravelSelectableServiceProvider"
41+
],
42+
"aliases": {
43+
"LaravelSelectable": "Ringlesoft\\LaravelSelectable\\Facades\\Selectable"
44+
},
45+
"dont-discover": [
46+
]
47+
}
48+
},
49+
"branches": {
50+
"stable": {
51+
"name": "master"
52+
}
53+
},
54+
"version": "1.0.0",
55+
"minimum-stability": "dev",
56+
"prefer-stable": true
57+
}

config/laravel_selectable.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
return [
3+
"css_library" => null,
4+
];

src/Facades/Selectable.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Ringlesoft\LaravelSelectable\Facades;
4+
5+
use Illuminate\Support\Facades\Facade;
6+
use RingleSoft\LaravelSelectable\LaravelSelectableServiceProvider;
7+
8+
class Selectable extends Facade
9+
{
10+
protected static function getFacadeAccessor(): string
11+
{
12+
return LaravelSelectableServiceProvider::class;
13+
}
14+
}

0 commit comments

Comments
 (0)