Skip to content

Commit daf3c86

Browse files
authored
Merge pull request #5826 from Laravel-Backpack/ensure-proper-crud-identification-on-uploaders
ensure proper crud identification
2 parents d38bffc + 5720087 commit daf3c86

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/CrudPanelManager.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ public function identifyCrudPanel(): CrudPanel
213213

214214
foreach ($trace as $step) {
215215
if (isset($step['class']) &&
216-
is_a($step['class'], CrudControllerContract::class, true)) {
216+
is_a($step['class'], CrudControllerContract::class, true) &&
217+
! is_a($step['class'], CrudController::class, true)) {
217218
$controller = (string) $step['class'];
218219
break;
219220
}
@@ -228,7 +229,7 @@ public function identifyCrudPanel(): CrudPanel
228229
$cruds = $this->getCrudPanels();
229230

230231
if (! empty($cruds)) {
231-
$crudPanel = reset($cruds);
232+
$crudPanel = end($cruds);
232233

233234
return $crudPanel;
234235
}

0 commit comments

Comments
 (0)