Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Feature | Add support for Laravel 10 #68

Merged
merged 4 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.COMMIT_TOKEN }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@1.0.0

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1]
laravel: [8.*, 9.*]
php: [8.1, 8.2]
laravel: [9.*, 10.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: ^6.24
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*

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

Expand All @@ -34,7 +34,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, exif, iconv, fileinfo
coverage: none

- name: Setup problem matchers
Expand Down
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
"homepage": "https://github.com/sammyjo20/laravel-haystack",
"require": {
"php": "^8.1",
"illuminate/console": "^8.0 || ^9.0",
"illuminate/contracts": "^8.0 || ^9.0",
"illuminate/database": "^8.0 || ^9.0",
"illuminate/queue": "^8.0 || ^9.0",
"illuminate/support": "^8.0 || ^9.0",
"illuminate/console": "^9.0 || ^10.0",
"illuminate/contracts": "^9.0 || ^10.0",
"illuminate/database": "^9.0 || ^10.0",
"illuminate/queue": "^9.0 || ^10.0",
"illuminate/support": "^9.0 || ^10.0",
"laravel/serializable-closure": "^1.2"
},
"require-dev": {
"jessarcher/laravel-castable-data-transfer-object": "^2.2",
"laravel/pint": "^1.0",
"orchestra/testbench": "^6.24|^7.8",
"orchestra/testbench": "^7.8 || ^8.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.2",
"sammyjo20/laravel-chunkable-jobs": "^0.2.0",
"sammyjo20/laravel-chunkable-jobs": "^1.0",
"spatie/laravel-ray": "^1.26"
},
"suggest": {
Expand Down
24 changes: 16 additions & 8 deletions tests/Fixtures/DataObjects/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@

namespace Sammyjo20\LaravelHaystack\Tests\Fixtures\DataObjects;

use JessArcher\CastableDataTransferObject\CastableDataTransferObject;

class Repository extends CastableDataTransferObject
class Repository
{
public readonly string $name;

public readonly string $stars;

public readonly string $isLaravel;
/**
* Constructor
*
* @param string $name
* @param int $stars
* @param bool $isLaravel
*/
public function __construct(
public readonly string $name,
public readonly int $stars,
public readonly bool $isLaravel,
)
{
//
}
}
3 changes: 2 additions & 1 deletion tests/Unit/HaystackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
use Sammyjo20\LaravelHaystack\Casts\Serialized;
use Sammyjo20\LaravelHaystack\Data\NextJob;
use Sammyjo20\LaravelHaystack\Models\Haystack;
use Sammyjo20\LaravelHaystack\Models\HaystackBale;
Expand Down Expand Up @@ -375,7 +376,7 @@ function myFunction()
$haystack->setData('name', 'Sam');
$haystack->setData('data', ['name' => 'Sam', 'work' => 'Plannr Technologies'], 'array');
$haystack->setData('age', 21, 'integer');
$haystack->setData('repository', $repository, Repository::class);
$haystack->setData('repository', $repository, Serialized::class);

expect($haystack->data()->count())->toEqual(4);

Expand Down