Initial commit

This commit is contained in:
2026-01-25 21:03:33 +01:00
commit 8d8e213f1c
2570 changed files with 479666 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace Vanguard\Presenters;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
abstract class Presenter
{
public function __construct(protected Model $model)
{
}
public function __isset($property): bool
{
return method_exists($this, Str::camel($property));
}
public function __get($property): mixed
{
$camel_property = Str::camel($property);
if (method_exists($this, $camel_property)) {
return $this->{$camel_property}();
}
return $this->model->{Str::snake($property)};
}
}