FEATURE: change directory structure

This commit is contained in:
Michal Kváček
2016-10-17 00:07:21 +02:00
parent 87f1920373
commit 2ded2924a1
242 changed files with 742 additions and 1171 deletions
+33
View File
@@ -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;
}
}