20 lines
485 B
PHP
20 lines
485 B
PHP
<?php
|
|
namespace App\Models\Widgets\ModelTraits;
|
|
|
|
use App\Models\Widgets\WidgetInWidgetArea as WidgetInWidgetAreaModel;
|
|
|
|
trait WidgetInWidgetArea
|
|
{
|
|
public static function getWidgetIdsFromArea($widgetAreaId)
|
|
{
|
|
$models = WidgetInWidgetAreaModel::where('widget_area_id', $widgetAreaId)
|
|
->get();
|
|
|
|
$ids = [];
|
|
foreach ($models as $model) {
|
|
$ids[] = $model->widget_id;
|
|
}
|
|
|
|
return $ids;
|
|
}
|
|
} |