Skip to content

Commit

Permalink
Allow for named arguments via dispatchable trait (#38066)
Browse files Browse the repository at this point in the history
  • Loading branch information
sleicester authored Jul 20, 2021
1 parent aca553a commit f13ae4c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Illuminate/Foundation/Bus/Dispatchable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ trait Dispatchable
*
* @return \Illuminate\Foundation\Bus\PendingDispatch
*/
public static function dispatch()
public static function dispatch(...$arguments)
{
return new PendingDispatch(new static(...func_get_args()));
return new PendingDispatch(new static(...$arguments));
}

/**
Expand Down Expand Up @@ -52,9 +52,9 @@ public static function dispatchUnless($boolean, ...$arguments)
*
* @return mixed
*/
public static function dispatchSync()
public static function dispatchSync(...$arguments)
{
return app(Dispatcher::class)->dispatchSync(new static(...func_get_args()));
return app(Dispatcher::class)->dispatchSync(new static(...$arguments));
}

/**
Expand All @@ -64,19 +64,19 @@ public static function dispatchSync()
*
* @deprecated Will be removed in a future Laravel version.
*/
public static function dispatchNow()
public static function dispatchNow(...$arguments)
{
return app(Dispatcher::class)->dispatchNow(new static(...func_get_args()));
return app(Dispatcher::class)->dispatchNow(new static(...$arguments));
}

/**
* Dispatch a command to its appropriate handler after the current process.
*
* @return mixed
*/
public static function dispatchAfterResponse()
public static function dispatchAfterResponse(...$arguments)
{
return app(Dispatcher::class)->dispatchAfterResponse(new static(...func_get_args()));
return app(Dispatcher::class)->dispatchAfterResponse(new static(...$arguments));
}

/**
Expand Down

0 comments on commit f13ae4c

Please sign in to comment.