foundation-laravel
foundation-laravel copied to clipboard
Allow alternative notation for constructor arguments in ServeFeaturesTrait
The current implementation of ServeFeaturesTrait doesn't allow for the following:
$output = $this->serve(new GetReachEstimateFeature($adAccount, $accessToken));
which is inconsistent with JobDispatcherTrait
that offers 2 alternative styles of passing constructor arguments:
$this->run(GetTotalReachEstimateJob::class, [
'adAccount' => $adAccount,
'accessToken' => $accessToken,
]);
and this:
$this->run(new GetTotalReachEstimateJob($adAccount, $accessToken));
The proposed PR is supposed to fix that.