support null models
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user