Skip to content

Commit 9873a69

Browse files
author
Just Chris
committed
chore: setup package with running php configure.php
1 parent 602a917 commit 9873a69

26 files changed

+279
-464
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: :vendor_name
1+
github: Ratoufa

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/:vendor_slug/:package_name/discussions/new?category=q-a
4+
url: https://github.com/ratoufa/laravel-billing/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/:vendor_slug/:package_name/discussions/new?category=ideas
7+
url: https://github.com/ratoufa/laravel-billing/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/:vendor_slug/:package_name/security/policy
10+
url: https://github.com/ratoufa/laravel-billing/security/policy
1111
about: Learn how to notify us for sensitive bugs

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
All notable changes to `:package_name` will be documented in this file.
3+
All notable changes to `laravel-billing` will be documented in this file.

CLAUDE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Laravel billing package for the Ratoufa project. Built on PHP 8.4+ with Laravel 11/12 support using Spatie's Laravel Package Tools.
8+
9+
## Commands
10+
11+
```bash
12+
# Run all tests and checks
13+
composer test
14+
15+
# Run specific test suites
16+
composer test:unit # Pest tests (parallel)
17+
composer test:types # PHPStan static analysis
18+
composer test:lint # Pint code style check
19+
composer test:typos # Peck typo checker
20+
composer test:refactor # Rector dry-run
21+
composer test:type-coverage # Type coverage (requires 100%)
22+
composer test:unit:coverage # Unit test coverage (requires 100%)
23+
24+
# Run a single test file
25+
./vendor/bin/pest tests/ExampleTest.php
26+
27+
# Run a single test by name
28+
./vendor/bin/pest --filter="test name here"
29+
30+
# Fix code style and run refactoring
31+
composer fix # Runs PHPStan, Rector, then Pint
32+
composer lint # Pint auto-fix
33+
composer refactor # Rector auto-fix
34+
composer analyse # PHPStan only
35+
```
36+
37+
## Architecture
38+
39+
This is a Laravel package using Spatie's `laravel-package-tools` for service provider configuration:
40+
41+
- `src/BillingServiceProvider.php` - Package configuration (config, views, migrations, commands)
42+
- `src/Billing.php` - Main service class
43+
- `src/Facades/Billing.php` - Facade for the Billing service
44+
- `src/Commands/` - Artisan commands
45+
- `config/billing.php` - Package configuration
46+
- `database/migrations/` - Migration stubs (published with `--tag="laravel-billing-migrations"`)
47+
48+
Tests use Orchestra Testbench with Pest. Base test case in `tests/TestCase.php` configures the package providers and factory resolution.
49+
50+
## Code Style Requirements
51+
52+
Enforced via Pint (`pint.json`):
53+
- `declare(strict_types=1)` required
54+
- Classes should be `final`
55+
- Use `DateTimeImmutable` over `DateTime`
56+
- Use `mb_str_*` functions
57+
- Strict comparisons (`===`, `!==`)
58+
- Specific class element ordering (traits, constants, properties, constructor, then methods by visibility)
59+
60+
Architecture tests (`tests/ArchTest.php`) forbid: `dd`, `dump`, `ray`

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) :vendor_name <author@domain.com>
3+
Copyright (c) Ratoufa <chrissem19@gmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
1-
# :package_description
2-
3-
[![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)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:vendor_slug/:package_slug/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/:vendor_slug/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/:vendor_slug/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:vendor_slug/:package_slug)
7-
<!--delete-->
8-
---
9-
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
10-
11-
1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
12-
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
13-
3. Have fun creating your package.
14-
4. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
15-
---
16-
<!--/delete-->
1+
# This is my package laravel-billing
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/ratoufa/laravel-billing.svg?style=flat-square)](https://packagist.org/packages/ratoufa/laravel-billing)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ratoufa/laravel-billing/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/ratoufa/laravel-billing/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/ratoufa/laravel-billing/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/ratoufa/laravel-billing/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/ratoufa/laravel-billing.svg?style=flat-square)](https://packagist.org/packages/ratoufa/laravel-billing)
7+
178
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
189

1910
## Support us
2011

21-
[<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)
12+
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/laravel-billing.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/laravel-billing)
2213

2314
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).
2415

@@ -29,20 +20,20 @@ We highly appreciate you sending us a postcard from your hometown, mentioning wh
2920
You can install the package via composer:
3021

3122
```bash
32-
composer require :vendor_slug/:package_slug
23+
composer require ratoufa/laravel-billing
3324
```
3425

3526
You can publish and run the migrations with:
3627

3728
```bash
38-
php artisan vendor:publish --tag=":package_slug-migrations"
29+
php artisan vendor:publish --tag="laravel-billing-migrations"
3930
php artisan migrate
4031
```
4132

4233
You can publish the config file with:
4334

4435
```bash
45-
php artisan vendor:publish --tag=":package_slug-config"
36+
php artisan vendor:publish --tag="laravel-billing-config"
4637
```
4738

4839
This is the contents of the published config file:
@@ -55,14 +46,14 @@ return [
5546
Optionally, you can publish the views using
5647

5748
```bash
58-
php artisan vendor:publish --tag=":package_slug-views"
49+
php artisan vendor:publish --tag="laravel-billing-views"
5950
```
6051

6152
## Usage
6253

6354
```php
64-
$variable = new VendorName\Skeleton();
65-
echo $variable->echoPhrase('Hello, VendorName!');
55+
$billing = new Ratoufa\Billing();
56+
echo $billing->echoPhrase('Hello, Ratoufa!');
6657
```
6758

6859
## Testing
@@ -85,7 +76,7 @@ Please review [our security policy](../../security/policy) on how to report secu
8576

8677
## Credits
8778

88-
- [:author_name](https://github.com/:author_username)
79+
- [Just Chris](https://github.com/justchr1s)
8980
- [All Contributors](../../contributors)
9081

9182
## License

composer.json

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": ":vendor_slug/:package_slug",
3-
"description": ":package_description",
2+
"name": "ratoufa/laravel-billing",
3+
"description": "This is my package laravel-billing",
44
"keywords": [
5-
":vendor_name",
5+
"Ratoufa",
66
"laravel",
7-
":package_slug"
7+
"laravel-billing"
88
],
9-
"homepage": "https://github.com/:vendor_slug/:package_slug",
9+
"homepage": "https://github.com/ratoufa/laravel-billing",
1010
"license": "MIT",
1111
"authors": [
1212
{
13-
"name": ":author_name",
14-
"email": "author@domain.com",
13+
"name": "Just Chris",
14+
"email": "chrissem19@gmail.com",
1515
"role": "Developer"
1616
}
1717
],
@@ -21,37 +21,59 @@
2121
"illuminate/contracts": "^11.0||^12.0"
2222
},
2323
"require-dev": {
24-
"laravel/pint": "^1.14",
25-
"nunomaduro/collision": "^8.8",
2624
"larastan/larastan": "^3.0",
25+
"laravel/pint": "^1.26",
26+
"nunomaduro/collision": "^8.8",
2727
"orchestra/testbench": "^10.0.0||^9.0.0",
28-
"pestphp/pest": "^4.0",
28+
"peckphp/peck": "^0.2.0",
29+
"pestphp/pest": "^4.2",
2930
"pestphp/pest-plugin-arch": "^4.0",
3031
"pestphp/pest-plugin-laravel": "^4.0",
32+
"pestphp/pest-plugin-type-coverage": "^4.0",
3133
"phpstan/extension-installer": "^1.4",
3234
"phpstan/phpstan-deprecation-rules": "^2.0",
3335
"phpstan/phpstan-phpunit": "^2.0",
36+
"rector/rector": "^2.2",
3437
"spatie/laravel-ray": "^1.35"
3538
},
3639
"autoload": {
3740
"psr-4": {
38-
"VendorName\\Skeleton\\": "src/",
39-
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories/"
41+
"Ratoufa\\Billing\\": "src/",
42+
"Ratoufa\\Billing\\Database\\Factories\\": "database/factories/"
4043
}
4144
},
4245
"autoload-dev": {
4346
"psr-4": {
44-
"VendorName\\Skeleton\\Tests\\": "tests/",
47+
"Ratoufa\\Billing\\Tests\\": "tests/",
4548
"Workbench\\App\\": "workbench/app/"
4649
}
4750
},
4851
"scripts": {
4952
"post-autoload-dump": "@composer run prepare",
5053
"prepare": "@php vendor/bin/testbench package:discover --ansi",
5154
"analyse": "vendor/bin/phpstan analyse",
52-
"test": "vendor/bin/pest",
53-
"test-coverage": "vendor/bin/pest --coverage",
54-
"format": "vendor/bin/pint"
55+
"test:type-coverage": "pest --parallel --type-coverage --exactly=100",
56+
"lint": "pint --parallel",
57+
"refactor": "rector",
58+
"test:typos": "peck",
59+
"test:lint": "pint --parallel --test",
60+
"test:unit": "pest --parallel",
61+
"test:unit:coverage": "pest --parallel --coverage --exactly=100",
62+
"test:types": "phpstan",
63+
"test:refactor": "rector --dry-run",
64+
"fix": [
65+
"@test:types",
66+
"@refactor",
67+
"@lint"
68+
],
69+
"test": [
70+
"@test:lint",
71+
"@test:type-coverage",
72+
"@test:typos",
73+
"@test:unit",
74+
"@test:types",
75+
"@test:refactor"
76+
]
5577
},
5678
"config": {
5779
"sort-packages": true,
@@ -63,10 +85,10 @@
6385
"extra": {
6486
"laravel": {
6587
"providers": [
66-
"VendorName\\Skeleton\\SkeletonServiceProvider"
88+
"Ratoufa\\Billing\\BillingServiceProvider"
6789
],
6890
"aliases": {
69-
"Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton"
91+
"Billing": "Ratoufa\\Billing\\Facades\\Billing"
7092
}
7193
}
7294
},

config/billing.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
// config for Ratoufa/Billing
6+
return [
7+
8+
];

config/skeleton.php

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

0 commit comments

Comments
 (0)