laravel-ide-helper
laravel-ide-helper copied to clipboard
Defining database in $table no longer works?
Versions:
- ide-helper Version: 3.0.0
- Laravel Version: 11.9.1
- PHP Version: 8.3
Question:
Before updating to Laravel 11 and ide-helper 3.0.0 I could define a database in the $table field on a Model like protected $table = 'alternate_db.table
. Both databases use the same connection.
After the update this no longer generates any documentation that relies on the database table.
Is this intended? Are there any workarounds?
Before 3.0.0:
<?php
namespace App\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\Example
*
* @property int $id
* @property int $example_int
* @property string|null $example_string
*
* @method static Builder|Example newModelQuery()
* @method static Builder|Example newQuery()
* @method static Builder|Example query()
* @method static Builder|Example whereExampleInt($value)
* @method static Builder|Example whereExampleString($value)
* @method static Builder|Example whereId($value)
*
* @mixin Eloquent
*/
class Example extends Model {
protected $table = 'alternate_db.example';
public $timestamps = false;
}
After 3.0.0:
<?php
namespace App\Models;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* @method static Builder|Example newModelQuery()
* @method static Builder|Example newQuery()
* @method static Builder|Example query()
*
* @mixin Eloquent
*/
class Example extends Model {
protected $table = 'alternate_db.example';
public $timestamps = false;
}