FEATURE: change directory structure
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Widgets;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class WidgetInWidgetArea
|
||||
*/
|
||||
class WidgetInWidgetArea extends Model
|
||||
{
|
||||
protected $table = 'widget_in_widget_area';
|
||||
public $timestamps = false;
|
||||
protected $fillable = [
|
||||
'widget_id',
|
||||
'widget_area_id',
|
||||
'position'
|
||||
];
|
||||
protected $guarded = [];
|
||||
|
||||
public static function getWidgetIdsFromArea($widgetAreaId)
|
||||
{
|
||||
$models = WidgetInWidgetArea::where('widget_area_id', $widgetAreaId)
|
||||
->get();
|
||||
|
||||
$ids = [];
|
||||
foreach ($models as $model) {
|
||||
$ids[] = $model->widget_id;
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user