If you want a class extending Model to recognize Eloquent methods, just add the following in the top PHPDoc comment on the class:
@mixin Eloquent
Example:
<?php namespace App;
use Carbon\Carbon;
use Eloquent;
use Illuminate\Database\Eloquent\Model;
/**
* Post
*
* @mixin Eloquent
*/
class Post extends Model {
Edit Laravel 6+ (Last tested on 9.41.0)
use Illuminate\Database\Eloquent\Builder;
/**
* @mixin Builder
*/
Note:
Most of you probably are using ide-helper for Laravel, therefore this @mixin attribute is automatically generated for model Classes.