support null models

This commit is contained in:
2023-04-10 14:45:58 +10:00
parent aa76147144
commit 990cc66600

View File

@@ -297,11 +297,15 @@ class Conductor
* Run the conductor on a Model with the data stored in a Request.
*
* @param Request $request The request data.
* @param Model $model The model.
* @param Model|null $model The model.
* @return array The processed and transformed model data.
*/
final public static function model(Request $request, Model $model)
final public static function model(Request $request, mixed $model)
{
if ($model === null) {
return null;
}
$conductor_class = get_called_class();
$conductor = new $conductor_class();
@@ -365,6 +369,7 @@ class Conductor
// return $this->collection;
// }
/**
* Return the current conductor collection count.
*