Skip to content

Commit fe79e2b

Browse files
first commit
0 parents  commit fe79e2b

25 files changed

+607
-0
lines changed

.gitattributes

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/art export-ignore
10+
/docs export-ignore
11+
/tests export-ignore
12+
/workbench export-ignore
13+
/.editorconfig export-ignore
14+
/.php_cs.dist.php export-ignore
15+
/psalm.xml export-ignore
16+
/psalm.xml.dist export-ignore
17+
/testbench.yaml export-ignore
18+
/UPGRADING.md export-ignore
19+
/phpstan.neon.dist export-ignore
20+
/phpstan-baseline.neon export-ignore

.github/PULL_REQUEST_TEMPLATE.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--
2+
- Fill in the form below correctly. This will help the Codelabmw team to understand the PR and also work on it.
3+
-->
4+
5+
### What:
6+
7+
- [ ] Bug Fix
8+
- [ ] New Feature
9+
10+
### Description:
11+
12+
<!-- describe what your PR is solving -->
13+
14+
### Related:
15+
16+
<!-- link to the issue(s) your PR is solving. If it doesn't exist, remove the "Related" section. -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fix PHP code style issues
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.head_ref }}
21+
22+
- name: Fix PHP code style issues
23+
uses: aglipanci/[email protected]
24+
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v5
27+
with:
28+
commit_message: Fix styling

.github/workflows/run-tests.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- '.github/workflows/run-tests.yml'
8+
- 'phpunit.xml.dist'
9+
- 'composer.json'
10+
- 'composer.lock'
11+
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 5
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
php: [8.3]
21+
laravel: [11.*]
22+
stability: [prefer-lowest, prefer-stable]
23+
include:
24+
- laravel: 11.*
25+
testbench: 9.*
26+
carbon: ^2.63
27+
28+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: ${{ matrix.php }}
38+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
39+
coverage: pcov
40+
41+
- name: Setup problem matchers
42+
run: |
43+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
44+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
45+
46+
- name: Install dependencies
47+
run: |
48+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.os == 'windows-latest' && '^^^' || '' }}${{ matrix.carbon }}" --no-interaction --no-update
49+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
50+
51+
- name: List Installed Dependencies
52+
run: composer show -D
53+
54+
- name: Execute tests
55+
run: composer test

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Composer Related
2+
composer.lock
3+
/vendor
4+
5+
# Frontend Assets
6+
/node_modules
7+
8+
# Logs
9+
npm-debug.log
10+
yarn-error.log
11+
12+
# Caches
13+
.phpunit.cache
14+
.phpunit.result.cache
15+
/build
16+
17+
# IDE Helper
18+
_ide_helper.php
19+
_ide_helper_models.php
20+
.phpstorm.meta.php
21+
22+
# Editors
23+
/.idea
24+
/.fleet
25+
/.vscode
26+
27+
# Misc
28+
phpunit.xml
29+
phpstan.neon
30+
testbench.yaml
31+
/docs
32+
/coverage
33+
/workbench

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

CONTRIBUTING.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# CONTRIBUTING
2+
3+
Contributions are welcome, and are accepted via pull requests.
4+
Please review these guidelines before submitting any pull requests.
5+
6+
## Process
7+
8+
1. Fork the project
9+
1. Create a new branch
10+
1. Code, test, commit and push
11+
1. Open a pull request detailing your changes. Make sure to follow the [template](.github/PULL_REQUEST_TEMPLATE.md)
12+
13+
## Guidelines
14+
15+
* Please ensure the coding style running `composer lint`.
16+
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
17+
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
18+
* Please remember that we follow [SemVer](http://semver.org/).
19+
20+
## Setup
21+
22+
Clone your fork, then install the dev dependencies:
23+
24+
```bash
25+
composer install
26+
```
27+
28+
## Lint
29+
30+
Lint your code:
31+
32+
```bash
33+
composer lint
34+
```
35+
36+
Auto PHP refactoring:
37+
38+
```bash
39+
composer refactor
40+
```
41+
42+
## Tests
43+
44+
Run all tests:
45+
46+
```bash
47+
composer test
48+
```
49+
50+
Check types:
51+
52+
```bash
53+
composer test:types
54+
```
55+
56+
Typos:
57+
58+
```bash
59+
composer test:typos
60+
```
61+
62+
Unit tests:
63+
64+
```bash
65+
composer test:unit
66+
```

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Chikondi Kamwendo <[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
13+
all 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
21+
THE SOFTWARE.

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<p align="center">
2+
<img src="art/package-art.png" alt="Art">
3+
<p align="center">
4+
<a href="https://github.com/codelabmw/package-name/actions"><img alt="GitHub Workflow Status (master)" src="https://github.com/codelabmw/package-name/actions/workflows/run-tests.yml/badge.svg"></a>
5+
<a href="https://packagist.org/packages/codelabmw/package-name"><img alt="Total Downloads" src="https://img.shields.io/packagist/dt/codelabmw/package-name"></a>
6+
<a href="https://packagist.org/packages/codelabmw/package-name"><img alt="Latest Version" src="https://img.shields.io/packagist/v/codelabmw/package-name"></a>
7+
<a href="https://packagist.org/packages/codelabmw/package-name"><img alt="License" src="https://img.shields.io/packagist/l/codelabmw/package-name"></a>
8+
</p>
9+
</p>
10+
11+
A description of what the package is and what it does.
12+
13+
## Installation
14+
15+
> Requires PHP ^8.3
16+
17+
You can install the package via composer:
18+
19+
```bash
20+
composer require codelabmw/package-name
21+
```
22+
23+
## Usage
24+
25+
Instructions on how the package should and can be used including code examples.
26+
27+
```php
28+
<?php
29+
30+
declare(strict_types=1);
31+
32+
namespace Codelabmw\Package;
33+
34+
final class Example
35+
{
36+
/**
37+
* Creates Example instance.
38+
*/
39+
public function __construct(private readonly Package $package)
40+
{
41+
$package->doSomething();
42+
}
43+
}
44+
```
45+
46+
## Changelog
47+
48+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
49+
50+
## Contributing
51+
52+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
53+
54+
## Credits
55+
56+
- [Chikondi Kamwendo](https://github.com/kondi3)
57+
- [All Contributors](../../contributors)
58+
59+
## License
60+
61+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

art/package-art.png

9.41 KB
Loading

composer.json

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"name": "codelabmw/laravel-package-skeleton",
3+
"description": "A minimal template repository for Codelab's headless Laravel packages.",
4+
"keywords": [
5+
"laravel"
6+
],
7+
"type": "library",
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "Chikondi Kamwendo",
12+
"email": "[email protected]"
13+
}
14+
],
15+
"autoload": {
16+
"psr-4": {
17+
"Codelabmw\\LaravelPackageSkeleton\\": "src/"
18+
}
19+
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"Codelabmw\\Tests\\": "tests/"
23+
}
24+
},
25+
"require": {
26+
"php": "^8.3",
27+
"illuminate/support": "^11.43"
28+
},
29+
"require-dev": {
30+
"laravel/pint": "^1.21",
31+
"orchestra/testbench": "^9.11",
32+
"peckphp/peck": "^0.1.2",
33+
"pestphp/pest": "^3.7",
34+
"pestphp/pest-plugin-arch": "^3.0",
35+
"pestphp/pest-plugin-type-coverage": "^3.3",
36+
"phpstan/phpstan": "^2.1",
37+
"rector/rector": "^2.0"
38+
},
39+
"minimum-stability": "dev",
40+
"prefer-stable": true,
41+
"config": {
42+
"sort-packages": true,
43+
"preferred-install": "dist",
44+
"allow-plugins": {
45+
"pestphp/pest-plugin": true
46+
}
47+
},
48+
"scripts": {
49+
"lint": "pint",
50+
"refactor": "rector",
51+
"test:type-coverage": "pest --type-coverage --min=100",
52+
"test:typos": "peck",
53+
"test:lint": "pint --test",
54+
"test:unit": "pest --coverage --exactly=100",
55+
"test:types": "phpstan",
56+
"test:refactor": "rector --dry-run",
57+
"test": [
58+
"@test:lint",
59+
"@test:refactor",
60+
"@test:types",
61+
"@test:typos",
62+
"@test:type-coverage",
63+
"@test:unit"
64+
]
65+
}
66+
}

config/.gitkeep

Whitespace-only changes.

database/.gitkeep

Whitespace-only changes.

peck.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"preset": "laravel",
3+
"ignore": {
4+
"words": [
5+
"php"
6+
],
7+
"paths": []
8+
}
9+
}

phpstan-baseline.neon

Whitespace-only changes.

0 commit comments

Comments
 (0)