mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
* Add custom collection support for get and all methods * Only add get and all when using custom collection * Use static instead of class name * Add missing custom collection test with relation * Use class reference over string Co-Authored-By: Markus Podar <[email protected]> * Fix when using class reference Co-authored-by: Markus Podar <[email protected]>
21 lines
569 B
PHP
21 lines
569 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection\Models;
|
|
|
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection\Collections\SimpleCollection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Simple extends Model
|
|
{
|
|
public function newCollection(array $models = [])
|
|
{
|
|
return new SimpleCollection($models);
|
|
}
|
|
|
|
public function relationHasMany(): HasMany
|
|
{
|
|
return $this->hasMany(Simple::class);
|
|
}
|
|
}
|