-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Bug description
I have register the following macro in my AppServiceProvider class
use Illuminate\Database\Eloquent\Builder;
Builder::macro('searchFor', function (string|array $attributes, string $searchTerm) {
$attributes = \Arr::wrap($attributes);
foreach ($attributes as $attribute) {
$this->query->orWhere(function ($query) use ($searchTerm, $attribute) {
foreach (explode(' ', $searchTerm) as $term) {
$query->whereRaw(
"LOWER($attribute COLLATE utf8mb4_unicode_ci) like LOWER(?)",
"%$term%"
);
}
});
}
return $this;
});However when I generate helper code it seems to skip the first argument ($attributes) for some reason.
Here is the generated signature on my _laravel_idea/_ide_helper_macro.php
namespace Illuminate\Database\Eloquent {
/**
...
* @method $this searchFor(string $searchTerm)
...
*/
class Builder {}
}My macro does work however PHPStorm complains that the signature is wrong.
Any thoughts?
Plugin version
No response
Operating system
MacOS
Steps to reproduce
As described above.
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
No labels
