Skip to content

Commit 451e455

Browse files
authored
Merge pull request #15 from Kristories/master
Update
2 parents dd184f0 + f75fd81 commit 451e455

21 files changed

+931
-175
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest]
18-
php: [8.1, 8.2, 8.3]
18+
php: [8.3, 8.4]
1919
include:
20-
- php: 8.1
21-
laravel: 9.*
22-
testbench: 7.*
23-
- php: 8.2
24-
laravel: 10.*
25-
testbench: 8.*
2620
- php: 8.3
2721
laravel: 11.*
2822
testbench: 9.*
23+
- php: 8.4
24+
laravel: 12.*
25+
testbench: 10.*
2926

3027
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}
3128

@@ -49,4 +46,4 @@ jobs:
4946
run: composer show -D
5047

5148
- name: Execute tests
52-
run: vendor/bin/phpunit --exclude-group skipped
49+
run: composer test

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
# Contributing
22

3-
Contributions are welcome and will be fully credited.
3+
Contributions are **welcome** and will be fully **credited**.
44

5-
Contributions are accepted via Pull Requests on Github.
5+
Please read and understand the contribution guide before creating an issue or pull request.
66

7-
## Pull Requests
7+
## Etiquette
88

9-
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)**.
10-
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
11-
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
12-
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
13-
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
14-
- **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](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
1512

16-
**Happy coding**!
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
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.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
# Laravel Helpers
2-
3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/devtical/laravel-helpers.svg?style=flat-square)](https://packagist.org/packages/devtical/laravel-drunk-on-419)
4-
[![Total Downloads](https://img.shields.io/packagist/dt/devtical/laravel-helpers.svg?style=flat-square)](https://packagist.org/packages/devtical/laravel-drunk-on-419)
5-
62
Helper Generator for Laravel
73

84
## Installation
@@ -16,13 +12,36 @@ composer require devtical/laravel-helpers
1612

1713
Publish the config by running the `php artisan vendor:publish` command.
1814

15+
Configure your helper directory:
16+
```bash
17+
# In your .env file
18+
HELPER_DIRECTORY=Helpers
19+
```
20+
1921
## Usage
2022

23+
Create your first helper file:
2124
```bash
2225
php artisan make:helper <NAME>
2326
```
27+
Add your helper functions:
28+
```php
29+
<?php
30+
31+
if (!function_exists('str_slug')) {
32+
function str_slug($text, $separator = '-')
33+
{
34+
return Str::slug($text, $separator);
35+
}
36+
}
37+
```
38+
39+
Use your helper functions anywhere:
40+
```php
41+
// In your controllers, models, views, etc.
42+
$slug = str_slug('Hello World'); // Returns: hello-world
43+
```
2444

25-
## Change log
2645

2746
Please see the [changelog](CHANGELOG.md) for more information on what has changed recently.
2847

@@ -42,9 +61,13 @@ If you discover any security related issues, please email author instead of usin
4261

4362
## Credits
4463

45-
- [Wahyu Kristianto](https://github.com/wearedevtical)
46-
- [All contributors](https://github.com/wearedevtical/laravel-helpers/graphs/contributors)
64+
- [Wahyu Kristianto](https://github.com/kristories)
65+
- [All contributors](https://github.com/devtical/laravel-helpers/graphs/contributors)
4766

4867
## License
4968

50-
The MIT License (MIT). Please see the [license file](LICENSE.md) for more information.
69+
This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
70+
71+
## Support
72+
73+
If you have any questions or need help, please open an issue on GitHub.

composer.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
{
22
"name": "devtical/laravel-helpers",
33
"description": "Helper Generator for Laravel",
4+
"version": "2.0.0",
45
"keywords": [
6+
"devtical",
57
"laravel",
68
"helper",
79
"generator"
810
],
11+
"homepage": "https://github.com/devtical/laravel-helpers",
912
"license": "MIT",
13+
"authors": [
14+
{
15+
"name": "W Kristianto",
16+
"email": "[email protected]"
17+
}
18+
],
1019
"require": {
1120
"php": "^7.2|^8.0",
1221
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0"
1322
},
1423
"require-dev": {
1524
"laravel/pint": "^1.18",
1625
"orchestra/testbench": "^4.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
17-
"phpunit/phpunit": "^8.4 || ^9.0 || ^10.0 || ^11.0",
18-
"friendsofphp/php-cs-fixer": "^3.0"
26+
"pestphp/pest": "^2.0",
27+
"pestphp/pest-plugin-laravel": "^2.0"
1928
},
2029
"autoload": {
2130
"psr-4": {
@@ -43,10 +52,9 @@
4352
}
4453
},
4554
"scripts": {
46-
"format": "vendor/bin/pint",
47-
"test": "vendor/bin/pest --colors=always",
48-
"analyse": "vendor/bin/phpstan analyse"
55+
"test": "vendor/bin/pest --no-coverage",
56+
"format": "vendor/bin/pint"
4957
},
50-
"minimum-stability": "dev",
58+
"minimum-stability": "stable",
5159
"prefer-stable": true
5260
}

config/helpers.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
return [
44

5-
'directory' => 'Helpers',
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Helper Directory
8+
|--------------------------------------------------------------------------
9+
|
10+
| This option controls the directory where your helper files will be stored.
11+
| The directory is relative to the app_path().
12+
|
13+
*/
14+
'directory' => env('HELPER_DIRECTORY', 'Helpers'),
615

716
];

phpstan-baseline.neon

Whitespace-only changes.

phpstan.neon.dist

Lines changed: 0 additions & 9 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
83
<testsuites>
9-
<testsuite name="League Test Suite">
4+
<testsuite name="Laravel Helpers Test Suite">
105
<directory>tests</directory>
116
</testsuite>
127
</testsuites>
8+
<coverage>
9+
<report>
10+
<html outputDirectory="build/coverage"/>
11+
<text outputFile="build/coverage.txt"/>
12+
<clover outputFile="build/logs/clover.xml"/>
13+
</report>
14+
</coverage>
15+
<logging>
16+
<junit outputFile="build/report.junit.xml"/>
17+
</logging>
18+
<source>
19+
<include>
20+
<directory suffix=".php">./src</directory>
21+
</include>
22+
</source>
1323
</phpunit>

pint.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"no_unused_imports": true,
5+
"ordered_imports": {
6+
"sort_algorithm": "alpha"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)