Skip to content

Commit 0341bc7

Browse files
committed
Package renaming
1 parent a665093 commit 0341bc7

File tree

14 files changed

+49
-51
lines changed

14 files changed

+49
-51
lines changed

.github/ISSUE_TEMPLATE/config.yml

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

CHANGELOG.md

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

3-
All notable changes to `laravel-useful-traits` will be documented in this file.
3+
All notable changes to `laravel-useful-additions` will be documented in this file.
44

55
## v2.0.0 - 2023-02-24
66

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# A collection of useful Laravel traits!
1+
# A collection of useful Laravel additions!
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laracraft-tech/laravel-useful-traits.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-useful-traits)
4-
[![Tests](https://github.com/laracraft-tech/laravel-useful-traits/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/laracraft-tech/laravel-useful-traits/actions/workflows/run-tests.yml)
5-
[![Check & fix styling](https://github.com/laracraft-tech/laravel-useful-traits/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/laracraft-tech/laravel-useful-traits/actions/workflows/fix-php-code-style-issues.yml)
6-
[![License](https://img.shields.io/packagist/l/laracraft-tech/laravel-useful-traits.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-useful-traits)
7-
<!--[![Total Downloads](https://img.shields.io/packagist/dt/laracraft-tech/laravel-useful-traits.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-useful-traits)-->
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laracraft-tech/laravel-useful-additions.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-useful-traits)
4+
[![Tests](https://github.com/laracraft-tech/laravel-useful-additions/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/laracraft-tech/laravel-useful-traits/actions/workflows/run-tests.yml)
5+
[![Check & fix styling](https://github.com/laracraft-tech/laravel-useful-additions/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/laracraft-tech/laravel-useful-traits/actions/workflows/fix-php-code-style-issues.yml)
6+
[![License](https://img.shields.io/packagist/l/laracraft-tech/laravel-useful-additions.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-useful-traits)
7+
<!--[![Total Downloads](https://img.shields.io/packagist/dt/laracraft-tech/laravel-useful-additions.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-useful-traits)-->
88

9-
Here we will over time share some useful Laravel traits we need in our daily work.
9+
Here we will share some useful Laravel additions we need in our daily work.
1010

11-
### Traits
11+
### Useful Additions
1212

1313
- [`UsefulEnums`](#usefulenums)
1414
- [`UsefulScopes`](#usefulscopes)
@@ -22,19 +22,17 @@ Here we will over time share some useful Laravel traits we need in our daily wor
2222
You can install the package via composer:
2323

2424
```bash
25-
composer require laracraft-tech/laravel-useful-traits
25+
composer require laracraft-tech/laravel-useful-additions
2626
```
2727

2828
Then publish the config file with:
2929

3030
```bash
31-
php artisan vendor:publish --tag="useful-traits-config"
31+
php artisan vendor:publish --tag="useful-additions-config"
3232
```
3333

3434
## Usage
3535

36-
The following traits are provided in the `LaracraftTech`-namespace:
37-
3836
### UsefulEnums
3937

4038
---
@@ -43,7 +41,7 @@ The following traits are provided in the `LaracraftTech`-namespace:
4341
This could be very handy if you like to **loop** over all of your **enum** types, or you maybe want to use the enum as an array, for instance in a migration.
4442

4543
```php
46-
use LaracraftTech\LaravelUsefulTraits\UsefulEnums;
44+
use LaracraftTech\LaravelUsefulAdditions\UsefulEnums;
4745

4846
enum PaymentType: int
4947
{
@@ -68,7 +66,7 @@ PaymentType::array(); // return ['Pending' => 1, 'Failed' => 2, 'Success' => 3
6866
Select all columns but given excluded array.
6967

7068
```php
71-
use LaracraftTech\LaravelUsefulTraits\UsefulScopes;
69+
use LaracraftTech\LaravelUsefulAdditions\UsefulScopes;
7270

7371
$class = new class extends Model
7472
{
@@ -101,7 +99,7 @@ Consider to **clear the cache** whenever you make a new **deployment/migration**
10199
Select all entries created today or yesterday.
102100

103101
```php
104-
use LaracraftTech\LaravelUsefulTraits\UsefulScopes;
102+
use LaracraftTech\LaravelUsefulAdditions\UsefulScopes;
105103

106104
$class = new class extends Model
107105
{
@@ -127,14 +125,14 @@ The base idea comes from [Mayahi](https://mayahi.net/laravel/make-refresh-databa
127125
It basically **only** migrates your database if the **migration** files has **changed**.
128126
So the first `migrate:fresh` takes a while (depending on how many migrations you have), and then it's incredible fast.
129127

130-
Optionally you can set `USEFUL_TRAITS_SEED_AFTER_FAST_DB_REFRESH` to `true` if you like to seed your database after the migration.
128+
Optionally you can set `USEFUL_ADDITIONS_SEED_AFTER_FAST_DB_REFRESH` to `true` if you like to seed your database after the migration.
131129

132130
Also make sure to add the `.phpunit.database.checksum` to your `.gitignore` file!
133131

134132
***Pest:***
135133
```php
136134

137-
use LaracraftTech\LaravelUsefulTraits\RefreshDatabaseFast;
135+
use LaracraftTech\LaravelUsefulAdditions\RefreshDatabaseFast;
138136

139137
uses(RefreshDatabaseFast::class);
140138

@@ -145,7 +143,7 @@ it('does_something', function() {
145143

146144
***PHPUnit:***
147145
```php
148-
use LaracraftTech\LaravelUsefulTraits\RefreshDatabaseFast;
146+
use LaracraftTech\LaravelUsefulAdditions\RefreshDatabaseFast;
149147
use Tests\TestCase;
150148

151149
class MyTest extends TestCase

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "laracraft-tech/laravel-useful-traits",
3-
"description": "A collection of useful Laravel traits!",
2+
"name": "laracraft-tech/laravel-useful-additions",
3+
"description": "A collection of useful Laravel additions!",
44
"keywords": [
55
"laracraft-tech",
66
"laravel",
7-
"laravel-useful-traits"
7+
"laravel-useful-additions"
88
],
9-
"homepage": "https://github.com/laracraft-tech/laravel-useful-traits",
9+
"homepage": "https://github.com/laracraft-tech/laravel-useful-additions",
1010
"license": "MIT",
1111
"authors": [
1212
{
@@ -35,13 +35,13 @@
3535
},
3636
"autoload": {
3737
"psr-4": {
38-
"LaracraftTech\\LaravelUsefulTraits\\": "src",
39-
"LaracraftTech\\LaravelUsefulTraits\\Database\\Factories\\": "database/factories"
38+
"LaracraftTech\\LaravelUsefulAdditions\\": "src",
39+
"LaracraftTech\\LaravelUsefulAdditions\\Database\\Factories\\": "database/factories"
4040
}
4141
},
4242
"autoload-dev": {
4343
"psr-4": {
44-
"LaracraftTech\\LaravelUsefulTraits\\Tests\\": "tests"
44+
"LaracraftTech\\LaravelUsefulAdditions\\Tests\\": "tests"
4545
}
4646
},
4747
"scripts": {
@@ -61,10 +61,10 @@
6161
"extra": {
6262
"laravel": {
6363
"providers": [
64-
"LaracraftTech\\LaravelUsefulTraits\\LaravelUsefulTraitsServiceProvider"
64+
"LaracraftTech\\LaravelUsefulAdditions\\LaravelUsefulAdditionsServiceProvider"
6565
],
6666
"aliases": {
67-
"LaravelUsefulTraits": "LaracraftTech\\LaravelUsefulTraits\\Facades\\LaravelUsefulTraits"
67+
"LaravelUsefulAdditions": "LaracraftTech\\LaravelUsefulAdditions\\Facades\\LaravelUsefulAdditions"
6868
}
6969
}
7070
},

config/useful-traits.php renamed to config/useful-additions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
/**
66
* This field determines if the database should be seeded after migration.
77
*/
8-
'seed' => env('USEFUL_TRAITS_SEED_AFTER_FAST_DB_REFRESH', false),
8+
'seed' => env('USEFUL_ADDITIONS_SEED_AFTER_FAST_DB_REFRESH', false),
99
],
1010
];
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace LaracraftTech\LaravelUsefulTraits;
3+
namespace LaracraftTech\LaravelUsefulAdditions;
44

55
use Spatie\LaravelPackageTools\Package;
66
use Spatie\LaravelPackageTools\PackageServiceProvider;
77

8-
class LaravelUsefulTraitsServiceProvider extends PackageServiceProvider
8+
class LaravelUsefulAdditionsServiceProvider extends PackageServiceProvider
99
{
1010
public function configurePackage(Package $package): void
1111
{
@@ -15,7 +15,7 @@ public function configurePackage(Package $package): void
1515
* More info: https://github.com/spatie/laravel-package-tools
1616
*/
1717
$package
18-
->name('laravel-useful-traits')
18+
->name('laravel-useful-additions')
1919
->hasConfigFile();
2020
}
2121
}

src/RefreshDatabaseFast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace LaracraftTech\LaravelUsefulTraits;
3+
namespace LaracraftTech\LaravelUsefulAdditions;
44

55
use Illuminate\Contracts\Console\Kernel;
66
use Illuminate\Foundation\Testing\RefreshDatabase;
@@ -40,7 +40,7 @@ protected function refreshTestDatabase(): void
4040
protected function runMigrationsIfNecessary(): void
4141
{
4242
if (! $this->identicalChecksum()) {
43-
if (config('useful-traits.refresh_db_fast.seed')) {
43+
if (config('useful-additions.refresh_db_fast.seed')) {
4444
$this->seed();
4545
}
4646

src/UsefulEnums.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace LaracraftTech\LaravelUsefulTraits;
3+
namespace LaracraftTech\LaravelUsefulAdditions;
44

55
trait UsefulEnums
66
{

src/UsefulScopes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace LaracraftTech\LaravelUsefulTraits;
3+
namespace LaracraftTech\LaravelUsefulAdditions;
44

55
use Illuminate\Database\Eloquent\Builder;
66
use Illuminate\Support\Facades\Cache;

tests/EnumTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use LaracraftTech\LaravelUsefulTraits\UsefulEnums;
3+
use LaracraftTech\LaravelUsefulAdditions\UsefulEnums;
44

55
it('can give array of enum', function () {
66
enum PaymentType: int

0 commit comments

Comments
 (0)