mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-01 21:00:58 +00:00
refactor(platform,adapters): rewrite legacy-era regions of the modules controller, resource, routes and rate recorders in place
This commit is contained in:
@@ -10,6 +10,6 @@ class MoneyExpenseExchangeRateRecorder implements ExpenseExchangeRateRecorder
|
||||
{
|
||||
public function record(Expense $expense): void
|
||||
{
|
||||
ExchangeRateLog::addExchangeRateLog($expense);
|
||||
ExchangeRateLog::addExchangeRateLog(model: $expense);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ class MoneyPaymentExchangeRateRecorder implements PaymentExchangeRateRecorder
|
||||
{
|
||||
public function record(Payment $payment): void
|
||||
{
|
||||
ExchangeRateLog::addExchangeRateLog($payment);
|
||||
ExchangeRateLog::addExchangeRateLog(model: $payment);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ class ModulesController extends Controller
|
||||
$installedModule->enable();
|
||||
$module->refresh();
|
||||
|
||||
ModuleEnabledEvent::dispatch($module);
|
||||
event(new ModuleEnabledEvent($module));
|
||||
|
||||
return response()->json(['success' => true]);
|
||||
return new JsonResponse(['success' => true]);
|
||||
}
|
||||
|
||||
public function disable(string $module, DatabaseActivator $activator): JsonResponse
|
||||
|
||||
@@ -11,7 +11,7 @@ use Illuminate\Support\Facades\File;
|
||||
class ModuleResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
* Merge one marketplace catalog row with locally installed module state.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return array|Arrayable|\JsonSerializable
|
||||
|
||||
@@ -5,6 +5,8 @@ use App\Platform\Modules\Http\Controllers\Assets\StyleController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware('web')->group(function () {
|
||||
Route::get('/modules/styles/{style}', StyleController::class);
|
||||
Route::get('/modules/scripts/{script}', ScriptController::class);
|
||||
Route::prefix('modules')->group(function () {
|
||||
Route::get('styles/{style}', StyleController::class);
|
||||
Route::get('scripts/{script}', ScriptController::class);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user