23 lines
507 B
PHP
23 lines
507 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Domain\PlannedItem\Actions;
|
||
|
|
|
||
|
|
use App\Models\PlannedItem;
|
||
|
|
|
||
|
|
class UpdatePlannedItemAction
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Update a planned item's properties
|
||
|
|
*
|
||
|
|
* @param PlannedItem $plannedItem
|
||
|
|
* @param array $data ['calendar_slot_id'?, 'sort_order'?]
|
||
|
|
* @return PlannedItem
|
||
|
|
*/
|
||
|
|
public function execute(PlannedItem $plannedItem, array $data): PlannedItem
|
||
|
|
{
|
||
|
|
$plannedItem->update($data);
|
||
|
|
|
||
|
|
return $plannedItem->load(['plannableItem', 'calendarSlot']);
|
||
|
|
}
|
||
|
|
}
|