It's called type hinting. You are telling PHP that the $query argument must be of type Builder (an instance of Illuminate\Database\Eloquent\Builder). If you are getting an error, you probably forgot to add use Illuminate\Database\Eloquent\Builder at the top of your file.
http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration
In this case, you are requiring a specific type of object but you can also do it for other types, like int or array. Depending on your use case, it might help with readability or to make sure that you cannot pass an argument of the wrong type to the method by accident:
public function example(int $count, array $data)
{
// $count MUST be an integer (or convertible to an integer)
// $data MUST be an array
}