#!/bin/bash

# Create a named pipe for output handling
PIPE=$(mktemp -u)
mkfifo $PIPE

# Start handling the output in background
cat $PIPE | grep -v '^\([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\|.*\.\{3\}\)' &

# Run artisan serve and redirect its output to our pipe
php artisan serve > $PIPE 2>&1

# Cleanup
rm $PIPE
