Initial Commit

This commit is contained in:
Mark Gregory
2026-04-21 09:12:51 +01:00
commit 6bc3c69c3e
151 changed files with 11917 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace mpba\Modules;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Collection as BaseCollection;
class Collection extends BaseCollection
{
/**
* Get items collections.
*
* @return array
*/
public function getItems()
{
return $this->items;
}
/**
* Get the collection of items as a plain array.
*
* @return array
*/
public function toArray()
{
return array_map(function ($value) {
if ($value instanceof Module) {
$attributes = $value->json()->getAttributes();
$attributes['path'] = $value->getPath();
return $attributes;
}
return $value instanceof Arrayable ? $value->toArray() : $value;
}, $this->items);
}
}