Auto-formatted by Laravel Pint (default Laravel preset): string concatenation spacing, anonymous class brace placement, constructor body shorthand, import ordering, and assertion indentation.
21 lines
490 B
PHP
21 lines
490 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Services\ChurchToolsService;
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
class SyncController extends Controller
|
|
{
|
|
public function sync(ChurchToolsService $service): RedirectResponse
|
|
{
|
|
try {
|
|
$service->sync();
|
|
|
|
return back()->with('success', 'Daten wurden aktualisiert');
|
|
} catch (\Throwable $e) {
|
|
return back()->with('error', 'Sync fehlgeschlagen: '.$e->getMessage());
|
|
}
|
|
}
|
|
}
|