Skip to content

Commit

Permalink
BulkActions.php is fixed for better detection module specific actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sevannerse committed Jun 22, 2020
1 parent d75bc24 commit 1e2ca0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Http/Controllers/Common/BulkActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\Common;

use Illuminate\Support\Str;
use App\Abstracts\Http\Controller;
use App\Http\Requests\Common\BulkAction as Request;

Expand Down Expand Up @@ -34,7 +35,10 @@ public function action($group, $type, Request $request)
$module = module($group);

if ($module instanceof \Akaunting\Module\Module) {
$bulk_actions = app('Modules\\' . $module->getStudlyName() . '\BulkActions\\' . ucfirst($type));
$tmp = explode('.', $type);
$file_name = !empty($tmp[1]) ? Str::studly($tmp[0]) . '\\' . Str::studly($tmp[1]) : Str::studly($tmp[0]);

$bulk_actions = app('Modules\\' . $module->getStudlyName() . '\BulkActions\\' . $file_name);
} else {
$bulk_actions = app('App\BulkActions\\' . ucfirst($group) . '\\' . ucfirst($type));
}
Expand Down

0 comments on commit 1e2ca0c

Please sign in to comment.