Skip to content

Commit 83a22a7

Browse files
authored
update to oxygen/core 1.0.0 (#13)
1 parent 301d24e commit 83a22a7

18 files changed

Lines changed: 49 additions & 54 deletions

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/cache@v4
2828
with:
2929
path: vendor
30-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
30+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }}
3131
restore-keys: |
3232
${{ runner.os }}-php-
3333

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
],
1616
"require": {
1717
"php": ">=8.1",
18-
"oxygen/core": "~0.15.0",
19-
"oxygen/crud": "~0.14.0",
18+
"oxygen/core": "~1.0.0",
2019
"oxygen/data": "~0.12.0",
21-
"oxygen/preferences": "~0.6.0",
2220
"illuminate/support": "^10.0",
2321
"laravel/sanctum": "^3.2",
2422
"guzzlehttp/guzzle": "^7.4.5",

migrations/2015_07_07_000000_create_auth_preferences.php

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

33
use Illuminate\Database\Migrations\Migration;
4-
use Oxygen\Preferences\Loader\PreferenceRepositoryInterface;
4+
use Oxygen\Core\Preferences\Loader\PreferenceRepositoryInterface;
55

66
class CreateAuthPreferences extends Migration {
77

migrations/2021_06_27_000000_create_auth_modules.php

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

33
use Illuminate\Database\Migrations\Migration;
4-
use Oxygen\Preferences\PreferencesManager;
4+
use Oxygen\Core\Preferences\PreferencesManager;
55

66
class CreateAuthModules extends Migration {
77

resources/preferences/appearance.auth.php

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

33
use Illuminate\Validation\Rule;
4-
use Oxygen\Preferences\Loader\PreferenceRepositoryInterface;
5-
use Oxygen\Preferences\Loader\DatabaseLoader;
4+
use Oxygen\Core\Facades\Preferences;
5+
use Oxygen\Core\Preferences\Loader\PreferenceRepositoryInterface;
6+
use Oxygen\Core\Preferences\Loader\DatabaseLoader;
67

78
Preferences::register('appearance.auth', function($schema) {
89
$schema->setTitle('Login & Logout');

resources/preferences/modules.auth.php

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

33
use Illuminate\Routing\Router;
4-
use Oxygen\Preferences\Loader\PreferenceRepositoryInterface;
5-
use Oxygen\Preferences\Loader\DatabaseLoader;
4+
use Oxygen\Core\Facades\Preferences;
5+
use Oxygen\Core\Preferences\Loader\PreferenceRepositoryInterface;
6+
use Oxygen\Core\Preferences\Loader\DatabaseLoader;
67

78
Preferences::register('modules.auth', function($schema) {
89
$schema->setTitle('Authentication');

resources/preferences/user.php

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

3+
use Oxygen\Core\Facades\Preferences;
4+
35
Preferences::addGroup('user', 'User');

src/AuthServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
use Oxygen\Auth\Repository\UserRepositoryInterface;
3333
use Oxygen\Core\Permissions\PermissionsInterface;
3434
use Oxygen\Data\BaseServiceProvider;
35-
use Oxygen\Preferences\PreferencesManager;
36-
use Oxygen\Preferences\SchemaRegistered;
35+
use Oxygen\Core\Preferences\PreferencesManager;
36+
use Oxygen\Core\Preferences\SchemaRegistered;
3737
use Oxygen\Auth\Listeners\EnforceTwoFactorAuth;
3838

3939
class AuthServiceProvider extends BaseServiceProvider {

src/Controller/AuthController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use Oxygen\Auth\Entity\User;
2020
use Oxygen\Auth\Repository\UserRepositoryInterface;
2121
use Oxygen\Data\Exception\InvalidEntityException;
22-
use Oxygen\Preferences\PreferenceNotFoundException;
23-
use Oxygen\Preferences\PreferencesManager;
22+
use Oxygen\Core\Preferences\PreferenceNotFoundException;
23+
use Oxygen\Core\Preferences\PreferencesManager;
2424
use Illuminate\Routing\Controller;
2525
use Oxygen\Core\Http\Notification;
2626
use Illuminate\Http\Exceptions\HttpResponseException;

src/Controller/GroupsController.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44

55
use Illuminate\Routing\Controller;
66
use Oxygen\Auth\Repository\GroupRepositoryInterface;
7-
use OxygenModule\Auth\Fields\GroupFieldSet;
8-
use Oxygen\Crud\Controller\BasicCrudApi;
9-
use Oxygen\Crud\Controller\SoftDeleteCrudApi;
7+
use Oxygen\Core\Controller\BasicCrudTrait;
8+
use Oxygen\Core\Controller\SoftDeleteCrudTrait;
109
use Webmozart\Assert\Assert;
1110

1211
class GroupsController extends Controller {
1312

14-
use BasicCrudApi, SoftDeleteCrudApi {
15-
SoftDeleteCrudApi::deleteDeleteApi insteadof BasicCrudApi;
13+
use BasicCrudTrait, SoftDeleteCrudTrait {
14+
SoftDeleteCrudTrait::deleteDeleteApi insteadof BasicCrudTrait;
1615
// we don't care about filtering by deleted status here
17-
BasicCrudApi::getListQueryParameters insteadof SoftDeleteCrudApi;
16+
BasicCrudTrait::getListQueryParameters insteadof SoftDeleteCrudTrait;
1817
}
1918

2019
const PER_PAGE = 50;
@@ -34,7 +33,7 @@ class GroupsController extends Controller {
3433
public function __construct(GroupRepositoryInterface $repository) {
3534
$this->repository = $repository;
3635
Assert::isInstanceOf($this->repository, GroupRepositoryInterface::class);
37-
BasicCrudApi::setupLangMappings(self::LANG_MAPPINGS);
36+
BasicCrudTrait::setupLangMappings(self::LANG_MAPPINGS);
3837
}
3938

4039
}

0 commit comments

Comments
 (0)