Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
25a2d08
Uploaders - Refactor and fixes (#5478)
pxpm Nov 7, 2024
5e19b52
trigger testing forkflow on PR
tabacitu Nov 25, 2024
4cab12a
Clean up uploaders (#5725)
pxpm Dec 5, 2024
ab85b4b
allow datatable url configuration (#5713)
pxpm Dec 5, 2024
51ca89b
use next branch for basset
pxpm Jan 7, 2025
012484f
require alpha version
pxpm Jan 22, 2025
55e09ef
bump basset version
pxpm Jan 22, 2025
17df67a
Lifecycle hooks for CRUD operations (#5687)
pxpm Feb 7, 2025
39e6f9b
"Agnostic" filters - decouple filters from datatables (#5714)
pxpm Feb 7, 2025
de4c238
bump basset version
pxpm Feb 27, 2025
fed8db0
Update composer.json
pxpm Mar 6, 2025
d901ea7
Apply fixes from StyleCI
StyleCIBot Mar 24, 2025
c80d637
datatable component (#5688)
pxpm Jun 9, 2025
f6fb8c9
move the list heading to the datatable component (#5808)
pxpm Jun 10, 2025
5087c1d
add Datagrid and Datalist components (#5810)
tabacitu Jun 19, 2025
c4bfb8f
Form component (no ajax form) (#5814)
pxpm Jun 24, 2025
562ddac
dataform component fixes (#5816)
pxpm Jun 24, 2025
b21d8c0
Added general chip blade file and chip widget (#5815)
tabacitu Jun 25, 2025
53c4ef9
Fix Form issues, Add *name* argument to forms (#5817)
pxpm Jun 25, 2025
c6bd8ce
Drop support for Laravel 10 and 11 (#5819)
tabacitu Jun 27, 2025
5a2517f
Fix hooks at setup level (#5818)
pxpm Jun 27, 2025
7a364e5
install dev-next version of generators
pxpm Jun 27, 2025
165fad2
Merge pull request #5820 from Laravel-Backpack/fix-install-of-generators
pxpm Jun 27, 2025
19d567a
require basset beta version (#5821)
tabacitu Jun 28, 2025
8e81ff0
fix scripts on table
pxpm Jul 1, 2025
6a84281
Merge pull request #5822 from Laravel-Backpack/fix-scripts-on-table
pxpm Jul 1, 2025
fc472b3
fix the keyboard shortcuts on forms
pxpm Jul 1, 2025
d38bffc
Merge pull request #5823 from Laravel-Backpack/fix-keyboard-shortcut-…
pxpm Jul 1, 2025
5720087
ensure proper crud identification
pxpm Jul 4, 2025
daf3c86
Merge pull request #5826 from Laravel-Backpack/ensure-proper-crud-ide…
pxpm Jul 4, 2025
dcfda85
fix hooks
pxpm Jul 7, 2025
10e333a
Merge pull request #5827 from Laravel-Backpack/lifecycle-hooks-regist…
pxpm Jul 7, 2025
a6118f7
fix crud field javacript issue
pxpm Jul 8, 2025
81e2317
Merge pull request #5828 from Laravel-Backpack/fix-crud-fields-script…
pxpm Jul 8, 2025
5958bdb
pass the form id to form content
pxpm Jul 14, 2025
3de5eeb
Merge pull request #5829 from Laravel-Backpack/pass-the-form-id-to-fo…
pxpm Jul 14, 2025
7e3e33d
add error page translations
pxpm Jul 14, 2025
774a83f
Merge pull request #5830 from Laravel-Backpack/add-error-page-transla…
pxpm Jul 14, 2025
a222bb5
fix export buttons
pxpm Jul 15, 2025
fc87ed7
wip
pxpm Jun 12, 2025
6924800
wip
pxpm Jun 12, 2025
bc30cfe
wip
pxpm Jul 15, 2025
fb5cf29
Merge pull request #5831 from Laravel-Backpack/fix-export-buttons
pxpm Jul 15, 2025
c7ebf3a
Merge pull request #5812 from Laravel-Backpack/fix-datatable-dom-prop…
pxpm Jul 15, 2025
da9be6b
map the ui files
pxpm Jul 16, 2025
028acc7
Merge pull request #5832 from Laravel-Backpack/map-the-ui-assets
pxpm Jul 16, 2025
e6b795a
fix table without export buttons
pxpm Jul 16, 2025
aeea538
Merge pull request #5833 from Laravel-Backpack/fix-datatables-when-no…
pxpm Jul 16, 2025
7a38c7e
always focus on error field
pxpm Jul 17, 2025
56e071e
Merge pull request #5834 from Laravel-Backpack/focus-on-error-fields
pxpm Jul 17, 2025
ef9f302
delete button redirect
pxpm Jul 17, 2025
ed4ea40
Apply fixes from StyleCI
StyleCIBot Jul 17, 2025
271c8a8
Merge pull request #5835 from Laravel-Backpack/delete-button-redirect…
pxpm Jul 17, 2025
b551937
Fix padding in name
jcastroa87 Jul 20, 2025
f5a4cda
Fix checkbox padding
jcastroa87 Jul 20, 2025
884e79d
Background of select2
jcastroa87 Jul 20, 2025
29a94e9
multiple fixes
pxpm Jul 22, 2025
9ef8a8e
Merge pull request #5837 from Laravel-Backpack/fix-ui
pxpm Jul 22, 2025
30f00a4
fix form error highlight
pxpm Jul 29, 2025
d1dcff1
Merge pull request #5840 from Laravel-Backpack/fix-error-highlight
pxpm Jul 29, 2025
6527150
allow user to choose locale and timezone
zachweix Aug 5, 2025
bf42132
Add toggle to JSON
zachweix Aug 5, 2025
4ab91c8
wip
pxpm Aug 11, 2025
079d0a5
Merge pull request #5847 from Laravel-Backpack/fix-filters
pxpm Aug 11, 2025
3509eed
Merge pull request #5845 from zachweix/json-toggle
pxpm Aug 19, 2025
6e6c038
Merge pull request #5844 from zachweix/updating-date-timezone
pxpm Aug 19, 2025
ef85577
fixes bulk actions
pxpm Aug 25, 2025
d982c9d
Merge pull request #5857 from Laravel-Backpack/fix-bulk-buttons
pxpm Aug 25, 2025
013ad87
fix the filter navbar
pxpm Aug 26, 2025
c62fd3c
Merge pull request #5858 from Laravel-Backpack/fix-filter-navbar
pxpm Aug 26, 2025
f4b8621
fix line buttons dropdown
pxpm Aug 26, 2025
3799356
Merge pull request #5859 from Laravel-Backpack/fix-line-buttons-as-dr…
pxpm Aug 26, 2025
3dcabf8
wip
pxpm Sep 3, 2025
891cf07
wip
pxpm Sep 3, 2025
2dbcb70
wip
pxpm Sep 3, 2025
8b2e6e3
wip
pxpm Sep 3, 2025
8af3c61
wip
pxpm Sep 3, 2025
8a9e968
Merge pull request #5862 from Laravel-Backpack/fix-dropdown-position
pxpm Sep 3, 2025
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
23 changes: 5 additions & 18 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: PHP Tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

Expand All @@ -19,25 +20,11 @@ jobs:
# run all combinations of the following, to make sure they're working together
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
php: ['8.1', '8.2', '8.3', '8.4']
laravel: [^10.0, ^11.0, ^12.0]
dbal: [^3.0]
phpunit: [10.*, 11.*]
php: ['8.2', '8.3', '8.4']
laravel: [^12.0]
dbal: [^4.0]
phpunit: [11.*]
dependency-version: [stable] # to add: lowest
exclude:
- laravel: "^11.0"
php: "8.1"
dbal: "^3.0"
- laravel: "^12.0"
php: "8.1"
dbal: "^3.0"
- laravel: "^12.0"
php: "8.2"
dbal: "^3.0"
- phpunit: "11.*"
laravel: "^10.0"
- phpunit: "10.*"
laravel: "^12.0"

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

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ composer.lock
.phpunit.result.cache
src/public/packages/
/.phpunit.cache
coverage/

17 changes: 10 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
}
],
"require": {
"laravel/framework": "^10.0|^11.0|^12",
"backpack/basset": "^1.1.1|^1.3.2",
"laravel/framework": "^12",
"backpack/basset": "^2.0.0-beta",
"creativeorange/gravatar": "^1.0",
"prologue/alerts": "^1.0",
"doctrine/dbal": "^3.0|^4.0",
"doctrine/dbal": "^4.0",
"guzzlehttp/guzzle": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0|^9.0|^11.0",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"phpunit/phpunit": "^11.0",
"orchestra/testbench": "^10.0",
"spatie/laravel-translatable": "^6.0"
},
"autoload": {
Expand All @@ -62,9 +62,12 @@
]
},
"scripts": {
"test": "vendor/bin/phpunit --testdox",
"test": [
"@putenv XDEBUG_MODE=off",
"vendor/bin/phpunit"
],
"test-failing": "vendor/bin/phpunit --order-by=defects --stop-on-failure",
"test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text"
"test-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage"
},
"extra": {
"branch-alias": {
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<include>
<directory suffix=".php">./src/app/Library/CrudPanel/Traits/</directory>
<directory>./src/app/Library/Validation/</directory>
<directory>./src/app/Library/Uploaders/</directory>
<directory suffix=".php">./src/app/Library/CrudPanel/</directory>
<directory suffix=".php">./src/app/Models/Traits/</directory>
<file>./src/app/Library/Widget.php</file>
Expand All @@ -35,9 +36,11 @@
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="BCRYPT_ROUNDS" value="12"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_FOREIGN_KEYS" value="true"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
Expand Down
76 changes: 69 additions & 7 deletions src/BackpackServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
use Backpack\Basset\Facades\Basset;
use Backpack\CRUD\app\Http\Middleware\EnsureEmailVerification;
use Backpack\CRUD\app\Http\Middleware\ThrottlePasswordRecovery;
use Backpack\CRUD\app\Library\CrudPanel\CrudPanel;
use Backpack\CRUD\app\Library\Database\DatabaseSchema;
use Backpack\CRUD\app\Library\Uploaders\Support\UploadersRepository;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Routing\Router;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\File;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Illuminate\View\Compilers\BladeCompiler;
Expand Down Expand Up @@ -63,6 +63,26 @@ public function boot(Router $router)
$this->sendUsageStats();

Basset::addViewPath(realpath(__DIR__.'/resources/views'));

foreach (config('backpack.ui.styles', []) as $style) {
if (is_array($style)) {
foreach ($style as $file) {
Basset::map($file);
}
} else {
Basset::map($style);
}
}

foreach (config('backpack.ui.scripts', []) as $script) {
if (is_array($script)) {
foreach ($script as $file) {
Basset::map($file);
}
} else {
Basset::map($script);
}
}
}

/**
Expand All @@ -78,19 +98,29 @@ public function register()
$this->loadViewsWithFallbacks('crud');
$this->loadViewsWithFallbacks('ui', 'backpack.ui');
$this->loadViewNamespace('widgets', 'backpack.ui::widgets');
ViewNamespaces::addFor('widgets', 'crud::widgets');

$this->loadViewComponents();
$this->registerDynamicBladeComponents();

$this->registerBackpackErrorViews();

// Bind the CrudPanel object to Laravel's service container
$this->app->scoped('crud', function ($app) {
return new CrudPanel();
$this->app->bind('crud', function ($app) {
return CrudManager::identifyCrudPanel();
});

$this->app->scoped('CrudManager', function ($app) {
return new CrudPanelManager();
});

$this->app->scoped('DatabaseSchema', function ($app) {
return new DatabaseSchema();
});

$this->app->scoped('BackpackLifecycleHooks', function ($app) {
return new app\Library\CrudPanel\Hooks\LifecycleHooks();
});

$this->app->singleton('BackpackViewNamespaces', function ($app) {
return new ViewNamespaces();
});
Expand Down Expand Up @@ -177,7 +207,7 @@ public function publishFiles()
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @param Router $router
* @return void
*/
public function setupRoutes(Router $router)
Expand All @@ -196,7 +226,7 @@ public function setupRoutes(Router $router)
/**
* Load custom routes file.
*
* @param \Illuminate\Routing\Router $router
* @param Router $router
* @return void
*/
public function setupCustomRoutes(Router $router)
Expand Down Expand Up @@ -314,6 +344,38 @@ public function loadViewComponents()
});
}

/**
* Register dynamic Blade components from the Components directory.
*
* Any Blade component classes that are in that directory will be registered
* as dynamic components with the 'bp-{component-name}' prefix.
*/
private function registerDynamicBladeComponents()
{
$path = __DIR__.'/app/View/Components';
$namespace = 'Backpack\\CRUD\\app\\View\\Components';

if (! is_dir($path)) {
return;
}

foreach (File::allFiles($path) as $file) {
$relativePath = str_replace(
['/', '.php'],
['\\', ''],
Str::after($file->getRealPath(), realpath($path).DIRECTORY_SEPARATOR)
);

$class = $namespace.'\\'.$relativePath;

// Check if the class exists and is a subclass of Illuminate\View\Component
// This ensures that only valid Blade components are registered.
if (class_exists($class) && is_subclass_of($class, \Illuminate\View\Component::class)) {
Blade::component('bp-'.Str::kebab(class_basename($class)), $class);
}
}
}

/**
* Load the Backpack helper methods, for convenience.
*/
Expand All @@ -329,7 +391,7 @@ public function loadHelpers()
*/
public function provides()
{
return ['crud', 'widgets', 'BackpackViewNamespaces', 'DatabaseSchema', 'UploadersRepository'];
return ['widgets', 'BackpackViewNamespaces', 'DatabaseSchema', 'UploadersRepository', 'CrudManager'];
}

private function registerBackpackErrorViews()
Expand Down
16 changes: 16 additions & 0 deletions src/CrudManager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Backpack\CRUD;

use Illuminate\Support\Facades\Facade;

/**
* @see CrudPanelManager
*/
class CrudManager extends Facade
{
protected static function getFacadeAccessor()
{
return 'CrudManager';
}
}
Loading