laravel-ide-helper: Error on ide-helper:generate on Laravel 5.7 with v2.5.0

When trying to generate a helper file I get the following output:

A new helper file was written to _ide_helper.php
Unexpected no document on Illuminate\Database\Eloquent\Model
Content did not change <?php

namespace Illuminate\Database\Eloquent;

use Exception;
use ArrayAccess;
use JsonSerializable;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Traits\ForwardsCalls;
use Illuminate\Contracts\Routing\UrlRoutable;
use Illuminate\Contracts\Queue\QueueableEntity;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Contracts\Queue\QueueableCollection;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\ConnectionResolverInterface as Resolver;

abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable

(cut output, full output here:https://pastebin.com/M3dDzQ51)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (2 by maintainers)

Commits related to this issue

Most upvoted comments

https://github.com/barryvdh/laravel-ide-helper/issues/623#issuecomment-363728595 explains that this error happens because Model does not have a docblock.

Until we have a proper solution, a temporary fix is manually adding a docblock to Illuminate\Database\Eloquent\Model, like this:


/**
 * Class Model
 *
 * @package Illuminate\Database\Eloquent 
 */
abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable
{

Hold my beer:

composer update

image

It’s a matter of principles. If you never used composer update, cool, but again, vendor folder is inmutable. This should be fixed inside the package, and avoid any modification to other packages.

In apples:

The functionality of the package should never depend on editing other packages.

I’m done with this stuff. I’ve created a fork.
It can be used as follows:

Add the new repository to your composer.json file:

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/iPaat/laravel-ide-helper"
    }
]

Change dependency to:

"require-dev": {
    "barryvdh/laravel-ide-helper": "dev-fixed",
}

I’m on 5.6.38 . and reverted to 2.4.3 and it’s working:

“barryvdh/laravel-ide-helper”: “2.4.3”,

@barryvdh pretty sure this was fixed with https://github.com/barryvdh/laravel-ide-helper/pull/624 and no recent reports => vote for closing :}