Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AdrienPoupa's avatar

Laravel Envoy: use command output in PHP

Hello,

I want to capture the output of a command and use it in PHP.

To be more specific: I want to run a git log --pretty=oneline, capture the output of this command and feed it to the @slack Blade directive.

Is there a simple way to do that?

Thanks!

0 likes
1 reply
Nash's avatar

Use exec

exec('git log --pretty=oneline', $output);

Please or to participate in this conversation.