Visuelle iCal-Regelengine mit Originaldaten und individuellen Exportfeldern integrieren
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m37s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m37s
This commit is contained in:
1 parent
c4ebccbbea
commit
e9db98701b
30 files changed
+1269
-15
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
use App\Channels\ICal\ICalRuleEngine;
|
||||
use App\Models\Channel;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SaveChannelRules
|
||||
{
|
||||
public function handle(Channel $channel, array $rules): Channel
|
||||
{
|
||||
return DB::transaction(function () use ($channel, $rules): Channel {
|
||||
$locked = Channel::query()->whereKey($channel->id)->lockForUpdate()->firstOrFail();
|
||||
$validated = app(ICalRuleEngine::class)->validate($locked, $rules);
|
||||
$locked->forceFill(['ical_rules' => $validated])->save();
|
||||
|
||||
return $locked;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user