Skip to content

Commit 3dcf0fd

Browse files
committed
Merge branch 'main' into pr/5351
2 parents 5da291e + 87be452 commit 3dcf0fd

File tree

177 files changed

+6905
-6009
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+6905
-6009
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ blank_issues_enabled: false
22
contact_links:
33
- name: Documentation issue
44
url: https://github.com/laravel-backpack/docs
5-
about: For documentation issues, open an issue or pull request in our docs repository.
6-
- name: How Do I X?
7-
url: https://stackoverflow.com/questions/tagged/backpack-for-laravel
8-
about: Backpack doesn't offer official support - only community support. Please post your question on StackOverflow, using the backpack-for-laravel tag. We've been blessed with a great community, that is happy to help.
9-
- name: Community Forum
5+
about: Please open an issue or pull request in our docs repository.
6+
- name: How Do I _____?
7+
url: https://github.com/Laravel-Backpack/community-forum/discussions
8+
about: Please use Discussions in our community forum. We've been blessed with a great community, that is happy to help.
9+
- name: Feature Request or Idea
1010
url: https://github.com/Laravel-Backpack/community-forum/discussions/new
11-
about: If you have an idea, question or problem and you don't know where it fits, use our Community Forum. This is where we hang out and talk about all kinds of stuff.
11+
about: If you have an idea, request or want to show something you did, use our Community Forum. This is where we all hang out.

.github/ISSUE_TEMPLATE/feature_request.md

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

.github/workflows/support.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
action:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: dessant/support-requests@v3
16+
- uses: dessant/support-requests@v4
1717
with:
1818
github-token: ${{ github.token }}
1919
support-label: 'Ask-It-On-Stack-Overflow'

.github/workflows/testing.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ jobs:
1919
# run all combinations of the following, to make sure they're working together
2020
matrix:
2121
# os: [ubuntu-latest, macos-latest, windows-latest]
22-
php: [8.1, 8.2, 8.3]
22+
php: ['8.1', '8.2', '8.3']
23+
laravel: [^10.0, ^11.0]
2324
dbal: [^3.0]
24-
laravel: [10.*]
2525
phpunit: [10.*]
26-
dependency-version: [stable] # to add: lowest
27-
26+
dependency-version: [stable] # to add: lowest
27+
exclude:
28+
- laravel: "^11.0"
29+
php: "8.1"
30+
dbal: "^3.0"
31+
2832

2933
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, PHPUnit ${{ matrix.phpunit }}, DBAL ${{ matrix.dbal }} --prefer-${{ matrix.dependency-version }}
3034

@@ -49,7 +53,12 @@ jobs:
4953
key: dependencies-${{ matrix.dependency-version }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-phpunit-${{ matrix.phpunit }}-composer-${{ hashFiles('composer.json') }}
5054
- name: Install dependencies
5155
run: |
52-
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
56+
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
5357
composer update --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
58+
- name: "Install dbal"
59+
if: ${{ matrix.laravel }} == 10
60+
run: composer require "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
61+
- name: "Update dependencies"
62+
run: composer update --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
5463
- name: Execute tests
5564
run: composer test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center">
22
<br>
33
<br>
4-
<a href="https://backpackforlaravel.com" title="Backpack Logo"><img src="https://camo.githubusercontent.com/50eeab913baf60d3e0dbc8bd4a7b35e1d18456fad04e353a75a4a444948b1a95/68747470733a2f2f6261636b7061636b666f726c61726176656c2e636f6d2f70726573656e746174696f6e2f696d672f6261636b7061636b2f6c6f676f732f6261636b7061636b5f6c6f676f5f636f6c6f722e706e673f763d32"></a>
4+
<a href="https://backpackforlaravel.com" title="Backpack Logo"><img src="https://backpackforlaravel.com/presentation/img/backpack/logos/backpack_logo.svg" width="450px"></a>
55
<br>
66
<br>
77
</p>

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,16 @@
3535
}
3636
],
3737
"require": {
38-
"laravel/framework": "^10.0",
38+
"laravel/framework": "^10.0|^11.0",
3939
"prologue/alerts": "^1.0",
40-
"backpack/basset": "^1.1.1",
40+
"backpack/basset": "^1.1.1|^1.3",
4141
"creativeorange/gravatar": "~1.0",
42-
"doctrine/dbal": "^3.0",
42+
"doctrine/dbal": "^3.0|^4.0",
4343
"guzzlehttp/guzzle": "^7.0"
4444
},
4545
"require-dev": {
46-
"phpunit/phpunit": "~10.0|~9.0",
47-
"scrutinizer/ocular": "~1.7",
48-
"orchestra/testbench": "^8.0",
46+
"phpunit/phpunit": "^10.0|^9.0",
47+
"orchestra/testbench": "^8.0|^9.0|^10.0",
4948
"spatie/laravel-translatable": "^6.0"
5049
},
5150
"autoload": {

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</source>
3636
<php>
3737
<env name="APP_ENV" value="testing"/>
38-
<env name="BCRYPT_ROUNDS" value="4"/>
38+
<env name="BCRYPT_ROUNDS" value="12"/>
3939
<env name="CACHE_DRIVER" value="array"/>
4040
<env name="DB_CONNECTION" value="sqlite"/>
4141
<env name="DB_DATABASE" value=":memory:"/>

src/BackpackServiceProvider.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function loadConfigs()
256256
// add the root disk to filesystem configuration
257257
app()->config['filesystems.disks.'.config('backpack.base.root_disk_name')] = [
258258
'driver' => 'local',
259-
'root' => base_path(),
259+
'root' => base_path(),
260260
];
261261

262262
/*
@@ -275,7 +275,7 @@ public function loadConfigs()
275275
[
276276
'backpack' => [
277277
'driver' => 'eloquent',
278-
'model' => config('backpack.base.user_model_fqn'),
278+
'model' => config('backpack.base.user_model_fqn'),
279279
],
280280
];
281281

@@ -292,18 +292,18 @@ public function loadConfigs()
292292
app()->config['auth.passwords'] = $laravelAuthPasswordBrokers +
293293
[
294294
'backpack' => [
295-
'provider' => 'backpack',
296-
'table' => $backpackPasswordBrokerTable,
297-
'expire' => config('backpack.base.password_recovery_token_expiration', 60),
298-
'throttle' => config('backpack.base.password_recovery_throttle_notifications'),
295+
'provider' => 'backpack',
296+
'table' => $backpackPasswordBrokerTable,
297+
'expire' => config('backpack.base.password_recovery_token_expiration', 60),
298+
'throttle' => config('backpack.base.password_recovery_throttle_notifications'),
299299
],
300300
];
301301

302302
// add the backpack_users guard to the configuration
303303
app()->config['auth.guards'] = app()->config['auth.guards'] +
304304
[
305305
'backpack' => [
306-
'driver' => 'session',
306+
'driver' => 'session',
307307
'provider' => 'backpack',
308308
],
309309
];

src/Stats.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,24 @@ private function sendUsageStats()
5050
$url = 'https://backpackforlaravel.com/api/stats';
5151
$method = 'PUT';
5252
$stats = [
53-
'URL' => url('') ?? false,
54-
'HTTP_HOST' => $_SERVER['HTTP_HOST'] ?? false,
55-
'APP_URL' => $_SERVER['APP_URL'] ?? false,
56-
'APP_ENV' => $this->app->environment() ?? false,
57-
'APP_DEBUG' => $_SERVER['APP_DEBUG'] ?? false,
58-
'SERVER_ADDR' => $_SERVER['SERVER_ADDR'] ?? false,
59-
'SERVER_ADMIN' => $_SERVER['SERVER_ADMIN'] ?? false,
60-
'SERVER_NAME' => $_SERVER['SERVER_NAME'] ?? false,
61-
'SERVER_PORT' => $_SERVER['SERVER_PORT'] ?? false,
62-
'SERVER_PROTOCOL' => $_SERVER['SERVER_PROTOCOL'] ?? false,
63-
'SERVER_SOFTWARE' => $_SERVER['SERVER_SOFTWARE'] ?? false,
64-
'DB_CONNECTION' => $_SERVER['DB_CONNECTION'] ?? false,
65-
'LARAVEL_VERSION' => $this->app->version() ?? false,
66-
'BACKPACK_CRUD_VERSION' => \Composer\InstalledVersions::getVersion('backpack/crud') ?? false,
67-
'BACKPACK_PRO_VERSION' => backpack_pro(),
68-
'BACKPACK_LICENSE' => config('backpack.base.license_code') ?? false,
69-
'BACKPACK_TOKEN_USERNAME' => config('backpack.base.token_username') ?? false,
70-
'BACKPACK_URL' => backpack_url('') ?? false,
53+
'URL' => url('') ?? false,
54+
'HTTP_HOST' => $_SERVER['HTTP_HOST'] ?? false,
55+
'APP_URL' => $_SERVER['APP_URL'] ?? false,
56+
'APP_ENV' => $this->app->environment() ?? false,
57+
'APP_DEBUG' => $_SERVER['APP_DEBUG'] ?? false,
58+
'SERVER_ADDR' => $_SERVER['SERVER_ADDR'] ?? false,
59+
'SERVER_ADMIN' => $_SERVER['SERVER_ADMIN'] ?? false,
60+
'SERVER_NAME' => $_SERVER['SERVER_NAME'] ?? false,
61+
'SERVER_PORT' => $_SERVER['SERVER_PORT'] ?? false,
62+
'SERVER_PROTOCOL' => $_SERVER['SERVER_PROTOCOL'] ?? false,
63+
'SERVER_SOFTWARE' => $_SERVER['SERVER_SOFTWARE'] ?? false,
64+
'DB_CONNECTION' => $_SERVER['DB_CONNECTION'] ?? false,
65+
'LARAVEL_VERSION' => $this->app->version() ?? false,
66+
'BACKPACK_CRUD_VERSION' => \Composer\InstalledVersions::getVersion('backpack/crud') ?? false,
67+
'BACKPACK_PRO_VERSION' => backpack_pro(),
68+
'BACKPACK_LICENSE' => config('backpack.base.license_code') ?? false,
69+
'BACKPACK_TOKEN_USERNAME' => config('backpack.base.token_username') ?? false,
70+
'BACKPACK_URL' => backpack_url('') ?? false,
7171
];
7272

7373
// send this info to the main website to store it in the db
@@ -118,10 +118,10 @@ private function makeGuzzleRequest($method, $url, $payload)
118118
try {
119119
$client = new \GuzzleHttp\Client();
120120
$res = $client->request($method, $url, [
121-
'form_params' => $payload,
122-
'http_errors' => false,
123-
'connect_timeout' => 0.5,
124-
'timeout' => 0.5,
121+
'form_params' => $payload,
122+
'http_errors' => false,
123+
'connect_timeout' => 0.5,
124+
'timeout' => 0.5,
125125
]);
126126
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
127127
// do nothing

src/ThemeServiceProvider.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
namespace Backpack\CRUD;
44

55
use Backpack\Basset\Facades\Basset;
6+
use Illuminate\Support\Facades\Blade;
67
use Illuminate\Support\ServiceProvider;
8+
use Illuminate\View\Compilers\BladeCompiler;
79

810
class ThemeServiceProvider extends ServiceProvider
911
{
@@ -12,6 +14,7 @@ class ThemeServiceProvider extends ServiceProvider
1214
protected string $packageName = 'theme-name';
1315
protected array $commands = [];
1416
protected bool $theme = true;
17+
protected null|string $componentsNamespace = null;
1518

1619
/**
1720
* -------------------------
@@ -57,6 +60,8 @@ public function autoboot(): void
5760
$this->loadRoutesFrom($this->packageRoutesFile());
5861
}
5962

63+
$this->registerPackageBladeComponents();
64+
6065
// Publishing is only necessary when using the CLI.
6166
if (app()->runningInConsole()) {
6267
$this->bootForConsole();
@@ -256,4 +261,13 @@ public function packageIsActiveTheme()
256261
return config('backpack.ui.view_namespace') === $viewNamespace ||
257262
config('backpack.ui.view_namespace_fallback') === $viewNamespace;
258263
}
264+
265+
public function registerPackageBladeComponents()
266+
{
267+
if ($this->componentsNamespace) {
268+
$this->app->afterResolving(BladeCompiler::class, function () {
269+
Blade::componentNamespace($this->componentsNamespace, $this->packageName);
270+
});
271+
}
272+
}
259273
}

0 commit comments

Comments
 (0)