Skip to content

Commit 0110c20

Browse files
authored
Merge pull request #7 from rappasoft/develop
v3
2 parents 6eb9d8b + deed7fc commit 0110c20

File tree

14 files changed

+181
-127
lines changed

14 files changed

+181
-127
lines changed

.github/workflows/run-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.0, 8.1]
17-
laravel: [9.*]
16+
php: [8.1]
17+
laravel: [10.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20-
- laravel: 9.*
21-
testbench: 7.0
20+
- laravel: 10.*
21+
testbench: 8.0
2222

2323
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2424

@@ -44,4 +44,4 @@ jobs:
4444
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4545
4646
- name: Execute tests
47-
run: vendor/bin/phpunit
47+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
build
77
composer.lock
88
coverage
9-
docs
109
phpunit.xml
1110
psalm.xml
1211
vendor
12+
.phpunit.cache

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to `laravel-patches` will be documented in this file.
44

5+
## 3.0.0 - 2023-04-03
6+
7+
### Added
8+
9+
- Laravel 10 Support
10+
511
## 2.0.1 - 2022-02-26
612

713
### Changed

README.md

Lines changed: 4 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
![Package Logo](https://banners.beyondco.de/Laravel%20Patches.png?theme=light&packageManager=composer+require&packageName=rappasoft%2Flaravel-patches&pattern=architect&style=style_1&description=Run+patches+migration+style+in+your+Laravel+applications.&md=1&showWatermark=0&fontSize=100px&images=puzzle)
22

33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/rappasoft/laravel-patches.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-patches)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/rappasoft/laravel-patches/Run%20Tests?label=tests)](https://github.com/rappasoft/laravel-patches/actions?query=workflow%3ATests+branch%3Amaster)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/rappasoft/laravel-patches/Check%20&%20fix%20styling?label=code%20style)](https://github.com/rappasoft/laravel-patches/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster)
4+
[![Styling](https://github.com/rappasoft/laravel-patches/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/rappasoft/laravel-patches/actions/workflows/php-cs-fixer.yml)
5+
[![Tests](https://github.com/rappasoft/laravel-patches/actions/workflows/run-tests.yml/badge.svg)](https://github.com/rappasoft/laravel-patches/actions/workflows/run-tests.yml)
66
[![Total Downloads](https://img.shields.io/packagist/dt/rappasoft/laravel-patches.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-patches)
77

88
### Enjoying this package? [Buy me a beer 🍺](https://www.buymeacoffee.com/rappasoft)
@@ -19,93 +19,9 @@ You can install the package via composer:
1919
composer require rappasoft/laravel-patches
2020
```
2121

22-
You can publish the config file with:
22+
## Documentation and Usage Instructions
2323

24-
```bash
25-
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-config"
26-
```
27-
28-
You can publish and run the migrations with:
29-
30-
```bash
31-
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-migrations"
32-
php artisan migrate
33-
```
34-
35-
## Usage
36-
37-
### Making Patches
38-
39-
```bash
40-
php artisan make:patch patch_1_0_0
41-
```
42-
43-
This created a timestamped patch file under database/patches.
44-
45-
### Running Patches
46-
47-
To run all available patches:
48-
49-
```bash
50-
php artisan patch
51-
```
52-
53-
To run each available patch in its own batch:
54-
55-
```bash
56-
php artisan patch --step
57-
```
58-
59-
To force the patches to run in production (deploy scripts, etc.):
60-
61-
```bash
62-
php artisan patch --force
63-
```
64-
65-
### Rolling Back Patches
66-
67-
To rollback all patches of the last batch:
68-
69-
```bash
70-
php artisan patch:rollback
71-
```
72-
73-
To rollback the last X patches regardless of batch:
74-
75-
```bash
76-
php artisan patch:rollback --step=X
77-
```
78-
79-
### Patch File Helpers
80-
81-
You may use the following helper commands from your patch files:
82-
83-
Log a line to the patches log column (up method only):
84-
85-
```php
86-
$this->log('10 users modified');
87-
```
88-
89-
Call an Artisan command with options:
90-
91-
```php
92-
$this->call($command, $parameters);
93-
```
94-
95-
Call a seeder by class name:
96-
97-
```php
98-
$this->seed($class);
99-
```
100-
101-
Truncate a table by name:
102-
103-
```php
104-
$this->truncate($table);
105-
```
106-
*Note: Does not disable foreign key checks.*
107-
108-
**Please feel free to PR new helpers.**
24+
See the [documentation](https://rappasoft.com/docs/laravel-patches) for detailed installation and usage instructions.
10925

11026
## Testing
11127

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"require": {
1818
"php": "^8.0",
1919
"spatie/laravel-package-tools": "^1.1",
20-
"illuminate/contracts": "^9.0"
20+
"illuminate/contracts": "^10.0"
2121
},
2222
"require-dev": {
2323
"friendsofphp/php-cs-fixer": "^3.1",
24-
"orchestra/testbench": "^7.0",
25-
"phpunit/phpunit": "^9.3",
24+
"orchestra/testbench": "^8.0",
25+
"phpunit/phpunit": "^10.1",
2626
"spatie/laravel-ray": "^1.9"
2727
},
2828
"autoload": {
@@ -37,7 +37,7 @@
3737
},
3838
"scripts": {
3939
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
40-
"test": "vendor/bin/phpunit --colors=always",
40+
"test": "vendor/bin/phpunit --colors=always --no-coverage",
4141
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
4242
},
4343
"config": {

docs/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: v3
3+
slogan: Run patches migration style in your Laravel applications.
4+
githubUrl: https://github.com/rappasoft/laravel-patches
5+
branch: master
6+
---

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Changelog
3+
weight: 4
4+
---
5+
6+
All notable changes to this package are documented [on GitHub](https://github.com/rappasoft/laravel-patches/blob/master/CHANGELOG.md).

docs/configuration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Configuration
3+
weight: 6
4+
---
5+
6+
You can publish the config file with:
7+
8+
```bash
9+
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-config"
10+
```
11+
12+
You can publish and run the migrations with:
13+
14+
```bash
15+
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-migrations"
16+
php artisan migrate
17+
```

docs/installation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Installation
3+
weight: 5
4+
---
5+
6+
You can install the package via composer:
7+
8+
```bash
9+
composer require rappasoft/laravel-patches
10+
```
11+

docs/introduction.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Introduction
3+
weight: 1
4+
---
5+
6+
<section class="article_badges">
7+
<a href="https://packagist.org/packages/rappasoft/laravel-patches"><img src="https://img.shields.io/packagist/v/rappasoft/laravel-patches.svg?style=flat-square" alt="Latest Version on Packagist"></a>
8+
<a href="https://github.com/rappasoft/laravel-patches/actions/workflows/php-cs-fixer.yml"><img src="https://github.com/rappasoft/laravel-patches/actions/workflows/php-cs-fixer.yml/badge.svg" alt="Styling"></a>
9+
<a href="https://github.com/rappasoft/laravel-patches/actions/workflows/run-tests.yml"><img src="https://github.com/rappasoft/laravel-patches/actions/workflows/run-tests.yml/badge.svg" alt="Tests"></a>
10+
<a href="https://packagist.org/packages/rappasoft/laravel-patches"><img src="https://img.shields.io/packagist/dt/rappasoft/laravel-patches.svg?style=flat-square" alt="Total Downloads"></a>
11+
</section>
12+
13+
This package generates patch files in the same fashion Laravel generates migrations. Each file is timestamped with an up and a down method and is associated with a batch. You may run or rollback patches with the commands below.
14+
15+
This is a very simple package. It runs whatever is in your up and down methods on each patch in the order the patches are defined. It currently does not handle any errors or database transactions, please make sure you account for everything and have a backup plan when running patches in production.

0 commit comments

Comments
 (0)