Skip to content

Commit

Permalink
Fixed issue #26 (Package overrides some of default nova routes)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongulov committed Oct 21, 2022
1 parent b5face5 commit d6a54fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Http/Controllers/FieldDestroyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function handle(NovaRequest $request): \Illuminate\Http\Response
$fieldNameArray = array_slice($explode, 1, -1);
$fieldName = implode('_', $fieldNameArray);

if (!in_array($fieldName, $resource->translatable)){
if (($resource->translatable === null && $fieldName === '') || !in_array($fieldName, $resource->translatable)){ // not translatable file
$controller = new \Laravel\Nova\Http\Controllers\FieldDestroyController;

return $controller($request);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/FieldDownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function show(NovaRequest $request)
$fieldNameArray = array_slice($explode, 1, -1);
$fieldName = implode('_', $fieldNameArray);

if (!in_array($fieldName, $resource->translatable)) { // not translatable file
if (($resource->translatable === null && $fieldName === '') || !in_array($fieldName, $resource->translatable)) { // not translatable file
$controller = new \Laravel\Nova\Http\Controllers\FieldDownloadController;

return $controller($request);
Expand Down

0 comments on commit d6a54fc

Please sign in to comment.