diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9ca7b25f7..b639ea742 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -13,11 +13,6 @@ jobs: php: [8.2, 8.1] laravel: [10.*, 9.*] dependency-version: [prefer-stable] - include: - - laravel: 10.* - testbench: 8.* - - laravel: 9.* - testbench: 7.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - uses: actions/checkout@v3 @@ -35,7 +30,7 @@ jobs: coverage: none - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - name: Run PHPStan run: ./vendor/bin/phpstan analyse diff --git a/packages/admin/composer.json b/packages/admin/composer.json index 4433d75e4..5e1e92678 100644 --- a/packages/admin/composer.json +++ b/packages/admin/composer.json @@ -41,8 +41,8 @@ "pragmarx/google2fa": "^8.0", "psr/simple-cache": "^3.0", "rappasoft/laravel-livewire-tables": "^2.12", - "shopper/core": "^2.1", - "shopper/sidebar": "^2.1", + "shopper/core": "self.version", + "shopper/sidebar": "self.version", "spatie/laravel-package-tools": "^1.15", "stevebauman/location": "^6.3.1", "wire-elements/modal": "^1.0.0", diff --git a/packages/admin/src/Http/Livewire/Components/Customers/Create.php b/packages/admin/src/Http/Livewire/Components/Customers/Create.php index b1acd128d..920a48af5 100644 --- a/packages/admin/src/Http/Livewire/Components/Customers/Create.php +++ b/packages/admin/src/Http/Livewire/Components/Customers/Create.php @@ -7,13 +7,13 @@ use Illuminate\Contracts\View\View; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Hash; -use Shopper\Core\Models\Address; use Shopper\Core\Models\Country; use Shopper\Core\Models\User; use Shopper\Core\Repositories\UserRepository; use Shopper\Core\Rules\Phone; use Shopper\Core\Traits\Attributes\WithAddress; use Shopper\Http\Livewire\AbstractBaseComponent; +use Shopper\Models\Address; use Shopper\Notifications\CustomerSendCredentials; class Create extends AbstractBaseComponent diff --git a/packages/admin/src/Http/Livewire/Components/Orders/Show.php b/packages/admin/src/Http/Livewire/Components/Orders/Show.php index 098cafaaa..12c62f3a0 100644 --- a/packages/admin/src/Http/Livewire/Components/Orders/Show.php +++ b/packages/admin/src/Http/Livewire/Components/Orders/Show.php @@ -14,8 +14,8 @@ use Shopper\Core\Events\Orders\Completed; use Shopper\Core\Events\Orders\Paid; use Shopper\Core\Events\Orders\Registered; -use Shopper\Core\Models\Address; use Shopper\Core\Models\Order; +use Shopper\Models\Address; class Show extends Component { diff --git a/packages/core/composer.json b/packages/core/composer.json index a5091c0a6..25c85dacb 100644 --- a/packages/core/composer.json +++ b/packages/core/composer.json @@ -4,6 +4,7 @@ "license": "MIT", "require": { "php": "^8.1", + "ext-intl": "*", "spatie/laravel-medialibrary": "^10.4.1", "spatie/laravel-permission": "^5.5.2", "staudenmeir/laravel-adjacency-list": "^1.0" diff --git a/packages/core/src/Models/Address.php b/packages/core/src/Models/Address.php index e8b6596b8..c6049cc3d 100644 --- a/packages/core/src/Models/Address.php +++ b/packages/core/src/Models/Address.php @@ -9,6 +9,12 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +/** + * @property-read int $id + * @property string $last_name + * @property string|null $first_name + * @property bool $is_default + */ class Address extends Model { use HasFactory; diff --git a/packages/core/src/Models/Order.php b/packages/core/src/Models/Order.php index 8387fccd5..b0a4a276b 100644 --- a/packages/core/src/Models/Order.php +++ b/packages/core/src/Models/Order.php @@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Shopper\Core\Enum\OrderStatus; use Shopper\Core\Traits\HasPrice; +use Shopper\Models\Address; /** * @property-read int $id diff --git a/packages/core/src/Models/User.php b/packages/core/src/Models/User.php index c7ff1261c..6ea6a33d3 100644 --- a/packages/core/src/Models/User.php +++ b/packages/core/src/Models/User.php @@ -13,6 +13,7 @@ use Illuminate\Notifications\Notifiable; use Shopper\Core\Traits\CanHaveDiscount; use Shopper\Core\Traits\HasProfilePhoto; +use Shopper\Models\Address; use Shopper\Traits\TwoFactorAuthenticatable; use Spatie\Permission\Traits\HasRoles; diff --git a/packages/core/src/helpers.php b/packages/core/src/helpers.php index 870aa9188..5dc84bb12 100644 --- a/packages/core/src/helpers.php +++ b/packages/core/src/helpers.php @@ -38,13 +38,6 @@ function generate_number(): string } } -if (! function_exists('shopper_version')) { - function shopper_version(): string - { - return Shopper::version(); - } -} - if (! function_exists('shopper_table')) { function shopper_table(string $table): string {