Skip to content

Commit

Permalink
Update doc for mix exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel committed Mar 4, 2022
1 parent e6e28d0 commit ee41fa4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,22 @@ You can optionally create a webpack alias and a before script to make generating
const {exec} = require('child_process');

mix.before(async () => {
await exec('php artisan ziggy:generate');
return new Promise((resolve, reject) => {
const process = exec('php artisan ziggy:generate');
process.stdout.on('data', (data) => {
console.log(data);
});
process.stderr.on('data', (data) => {
console.error(data);
});
process.on('exit', code => {
if (code !== 0) {
reject();
} else {
resolve();
}
});
});
});

// Mix v6
Expand Down

0 comments on commit ee41fa4

Please sign in to comment.