Skip to content

Commit e62cefa

Browse files
committed
Merge v2 branch.
1 parent 2e081a6 commit e62cefa

25 files changed

+113
-87
lines changed

.github/workflows/run_tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Tests
2+
3+
on: ['push', 'pull_request']
4+
5+
jobs:
6+
ci:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
php: [7.2, 7.3, 7.4, 8.0]
12+
laravel: [6.*]
13+
dependency-version: [prefer-stable, prefer-lowest]
14+
include:
15+
- laravel: 6.*
16+
testbench: 4.*
17+
18+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Testbench ${{ matrix.testbench }} (${{ matrix.dependency-version }})
19+
20+
steps:
21+
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Cache dependencies
26+
uses: actions/cache@v1
27+
with:
28+
path: ~/.composer/cache/files
29+
key: dependencies-php-${{ matrix.php }}-composer-${{ matrix.laravel }}-${{ matrix.testbench }}-${{ matrix.dependency-version }}
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
extensions: mbstring, zip
36+
tools: prestissimo
37+
coverage: pcov
38+
39+
- name: Install Composer dependencies
40+
run: |
41+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
42+
composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-suggest
43+
44+
- name: PHPUnit Testing
45+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ build
22
composer.lock
33
vendor
44
tests/data/*.csv
5+
.phpunit.result.cache

.travis.yml

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

README.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
**THIS PACKAGE IS NOT MAINTAINED ANYMORE**
2-
3-
Alternatives: https://github.com/michaeldyrynda/laravel-efficient-uuid & https://github.com/michaeldyrynda/laravel-model-uuid
4-
51
# Using optimised binary UUIDs in Laravel
62

7-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-binary-uuid.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-binary-uuid)
8-
[![Build Status](https://img.shields.io/travis/spatie/laravel-binary-uuid/master.svg?style=flat-square)](https://travis-ci.org/spatie/laravel-binary-uuid)
9-
[![Code coverage](https://scrutinizer-ci.com/g/spatie/laravel-binary-uuid/badges/coverage.png)](https://scrutinizer-ci.com/g/spatie/laravel-binary-uuid)
10-
[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-binary-uuid.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-binary-uuid)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/boxed-code/laravel-binary-uuid.svg?style=flat-square)](https://packagist.org/packages/boxed-code/laravel-binary-uuid)
4+
[![Tests](https://github.com/boxed-code/laravel-binary-uuid/actions/workflows/run_tests.yml/badge.svg)](https://github.com/boxed-code/laravel-binary-uuid/actions/workflows/run_tests.yml)
115
[![StyleCI](https://styleci.io/repos/110949385/shield?branch=master)](https://styleci.io/repos/110949385)
12-
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-binary-uuid.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-binary-uuid)
6+
7+
*Forked from the [archived package](https://github.com/spatie/laravel-binary-uuid) at spaite, maintenance releases only.*
138

149
Using a regular uuid as a primary key is guaranteed to be slow.
1510

@@ -26,7 +21,7 @@ The package currently only supports MySQL and SQLite.
2621
You can install the package via Composer:
2722

2823
```bash
29-
composer require spatie/laravel-binary-uuid
24+
composer require boxed-code/laravel-binary-uuid
3025
```
3126

3227
## Usage
@@ -40,11 +35,11 @@ Schema::create('table_name', function (Blueprint $table) {
4035
});
4136
```
4237

43-
To get your model to work with the encoded UUID (i.e. to use uuid as a primary key), you must let your model use the `Spatie\BinaryUuid\HasBinaryUuid` trait.
38+
To get your model to work with the encoded UUID (i.e. to use uuid as a primary key), you must let your model use the `BoxedCode\BinaryUuid\HasBinaryUuid` trait.
4439

4540
```php
4641
use Illuminate\Database\Eloquent\Model;
47-
use Spatie\BinaryUuid\HasBinaryUuid;
42+
use BoxedCode\BinaryUuid\HasBinaryUuid;
4843

4944
class TestModel extends Model
5045
{
@@ -56,7 +51,7 @@ If don't like the primary key named `uuid` you can manually specify the `getKeyN
5651

5752
```php
5853
use Illuminate\Database\Eloquent\Model;
59-
use Spatie\BinaryUuid\HasBinaryUuid;
54+
use BoxedCode\BinaryUuid\HasBinaryUuid;
6055

6156
class TestModel extends Model
6257
{
@@ -75,7 +70,7 @@ If you try converting your model to JSON with binary attributes, you will see er
7570

7671
```php
7772
use Illuminate\Database\Eloquent\Model;
78-
use Spatie\BinaryUuid\HasBinaryUuid;
73+
use BoxedCode\BinaryUuid\HasBinaryUuid;
7974

8075
class TestModel extends Model
8176
{

composer.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
{
2-
"name": "spatie/laravel-binary-uuid",
2+
"name": "boxed-code/laravel-binary-uuid",
33
"description": "Binary support for UUIDs in Laravel",
44
"keywords": [
55
"spatie",
66
"laravel-binary-uuid"
77
],
8-
"homepage": "https://github.com/spatie/laravel-binary-uuid",
8+
"homepage": "https://github.com/boxed-code/laravel-binary-uuid",
99
"license": "MIT",
1010
"authors": [
1111
{
1212
"name": "Brent Roose",
1313
"email": "brent@spatie.be",
1414
"homepage": "https://spatie.be",
1515
"role": "Developer"
16+
},
17+
{
18+
"name": "Oliver Green",
19+
"email": "green2go@gmail.com",
20+
"homepage": "https://boxedcode.co.uk",
21+
"role": "Maintainer"
1622
}
1723
],
1824
"require": {
19-
"php": "^7.1",
20-
"illuminate/queue": "~5.5.28|~5.6.0|~5.7.0",
21-
"ramsey/uuid": "^3.7"
25+
"php": "^7.2|^8.0",
26+
"illuminate/queue": "~6.0",
27+
"ramsey/uuid": "^3.0|^4.0"
2228
},
2329
"require-dev": {
24-
"orchestra/testbench": "^3.5|~3.6.0|~3.7.0",
25-
"phpunit/phpunit": "^6.5|^7.0",
30+
"orchestra/testbench": "^4.0",
31+
"phpunit/phpunit": "^8.0|^9.0",
2632
"scrutinizer/ocular": "^1.5"
2733
},
2834
"autoload": {
2935
"psr-4": {
30-
"Spatie\\BinaryUuid\\": "src"
36+
"BoxedCode\\BinaryUuid\\": "src"
3137
}
3238
},
3339
"autoload-dev": {
3440
"psr-4": {
35-
"Spatie\\BinaryUuid\\Test\\": "tests"
41+
"BoxedCode\\BinaryUuid\\Test\\": "tests"
3642
}
3743
},
3844
"scripts": {
@@ -44,7 +50,7 @@
4450
"extra": {
4551
"laravel": {
4652
"providers": [
47-
"Spatie\\BinaryUuid\\UuidServiceProvider"
53+
"BoxedCode\\BinaryUuid\\UuidServiceProvider"
4854
]
4955
}
5056
}

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<logging>
2828
<log type="tap" target="build/report.tap"/>
2929
<log type="junit" target="build/report.junit.xml"/>
30-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
30+
<log type="coverage-html" target="build/coverage"/>
3131
<log type="coverage-text" target="build/coverage.txt"/>
3232
<log type="coverage-clover" target="build/logs/clover.xml"/>
3333
</logging>

src/Builder.php

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

3-
namespace Spatie\BinaryUuid;
3+
namespace BoxedCode\BinaryUuid;
44

55
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
66

src/HasBinaryUuid.php

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

3-
namespace Spatie\BinaryUuid;
3+
namespace BoxedCode\BinaryUuid;
44

55
use Ramsey\Uuid\Uuid;
66
use Illuminate\Database\Eloquent\Model;

src/HasUuidPrimaryKey.php

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

3-
namespace Spatie\BinaryUuid;
3+
namespace BoxedCode\BinaryUuid;
44

55
/**
6-
* @deprecated The logic of this trait is moved to `Spatie\BinaryUuid\HasBinaryUuid` and this trait will be removed with the next major version.
6+
* @deprecated The logic of this trait is moved to `BoxedCode\BinaryUuid\HasBinaryUuid` and this trait will be removed with the next major version.
77
*/
88
trait HasUuidPrimaryKey
99
{

src/MySqlGrammar.php

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

3-
namespace Spatie\BinaryUuid;
3+
namespace BoxedCode\BinaryUuid;
44

55
use Illuminate\Support\Fluent;
66
use Illuminate\Database\Schema\Grammars\MySqlGrammar as IlluminateMySqlGrammar;

0 commit comments

Comments
 (0)