BulkActions.php is fixed for better detection module specific actions

This commit is contained in:
Sevan Nerse 2020-06-22 16:33:20 +03:00
parent d75bc24a36
commit 1e2ca0c35c

View File

@ -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;
@ -34,7 +35,10 @@ BulkActions extends Controller
$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));
}