refactor ClientWidgetContactController and ClientWidgetPageReferenceListController; replace caching logic with action classes for widget data retrieval, enhancing code clarity and maintainability
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Widget\Tasks;
|
||||
|
||||
use App\Containers\Widget\Models\ContactWidget;
|
||||
use App\Ship\Exceptions\NotFoundException;
|
||||
|
||||
class FindContactWidgetBySlugTask
|
||||
{
|
||||
public function run(string $slug): ContactWidget
|
||||
{
|
||||
$contactWidget = ContactWidget::query()
|
||||
->where('slug', $slug)
|
||||
->firstOrFail();
|
||||
|
||||
return $contactWidget;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user