add swiftpayments from old source

This commit is contained in:
2024-09-01 17:06:49 +05:00
parent 9d65fa72b6
commit a5978835d0
27 changed files with 1822 additions and 141 deletions

View File

@@ -27,5 +27,27 @@ class AppServiceProvider extends ServiceProvider
events: ['eloquent.created: *', 'eloquent.updated: *', 'eloquent.deleted: *'],
listener: fn (string $eventName, array $data) => storeResourceEvent($eventName, $data, request())
);
$this->loadMigrationsFrom($this->findModuleMigrations());
}
/**
* Find Module migrations
*
* @return array<int, string>
*/
public function findModuleMigrations(): array
{
/** @var array<int, string> */
$modulesDir = scandir(modules_path());
$migrationDirectories = [];
foreach ($modulesDir as $module) {
if (is_dir(modules_path($module.'/Database/Migrations'))) {
$migrationDirectories[] = modules_path($module.'/Database/Migrations');
}
}
return $migrationDirectories;
}
}

View File

@@ -79,6 +79,17 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
];
}
/**
* Register the application's Nova resources.
*
* @return void
*/
protected function resources(): void
{
Nova::resourcesIn(app_path('Nova'));
Nova::resourcesIn(app_path('Modules'));
}
/**
* Get the tools that should be listed in the Nova sidebar.
*