Initial British Artisan package
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
|
||||
|
||||
# British Artisan
|
||||
|
||||
British English command spellings for Laravel Artisan, with suitably dry corrections when the American spelling is used.
|
||||
|
||||
## What it does
|
||||
|
||||
British Artisan lets you use:
|
||||
|
||||
```bash
|
||||
php artisan optimise
|
||||
php artisan optimise:clear
|
||||
```
|
||||
|
||||
Laravel still receives and runs its native commands:
|
||||
|
||||
```bash
|
||||
php artisan optimize
|
||||
php artisan optimize:clear
|
||||
```
|
||||
|
||||
The British spelling runs silently. The American spelling still works, but receives a randomly selected reminder that the proper spelling exists.
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 8.2 or newer
|
||||
- Laravel 11, 12, or 13
|
||||
|
||||
## Installation
|
||||
|
||||
Install the package with Composer:
|
||||
|
||||
```bash
|
||||
composer require sebs-space/british-artisan
|
||||
```
|
||||
|
||||
Then run the one-off installer:
|
||||
|
||||
```bash
|
||||
php artisan british-artisan:install
|
||||
```
|
||||
|
||||
The installer updates the project-root `artisan` file so command-line arguments are translated before Laravel resolves the command.
|
||||
|
||||
## Usage
|
||||
|
||||
Use the British spelling as normal:
|
||||
|
||||
```bash
|
||||
php artisan optimise
|
||||
php artisan optimise:clear
|
||||
```
|
||||
|
||||
Any command beginning with `optimise` is translated to the matching `optimize` command before Laravel runs it.
|
||||
|
||||
The original American spelling continues to work:
|
||||
|
||||
```bash
|
||||
php artisan optimize:clear
|
||||
```
|
||||
|
||||
It simply receives a polite correction first.
|
||||
|
||||
## Uninstalling
|
||||
|
||||
Restore the original Laravel `artisan` bootstrap with:
|
||||
|
||||
```bash
|
||||
php artisan british-artisan:uninstall
|
||||
```
|
||||
|
||||
Then remove the package:
|
||||
|
||||
```bash
|
||||
composer remove sebs-space/british-artisan
|
||||
```
|
||||
|
||||
## Supported command translations
|
||||
|
||||
| British English | Laravel command |
|
||||
|---|---|
|
||||
| `optimise` | `optimize` |
|
||||
| `optimise:*` | `optimize:*` |
|
||||
|
||||
Additional command translations can be added in future releases.
|
||||
|
||||
## Planned improvements
|
||||
|
||||
- Publishable configuration
|
||||
- Custom correction messages
|
||||
- Additional British command spellings where real Artisan commands use American English
|
||||
|
||||
## Licence
|
||||
|
||||
British Artisan is open-source software licensed under the [MIT License](LICENSE).
|
||||
Reference in New Issue
Block a user