mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0c315e4fc | ||
|
|
6338abb2d7 | ||
|
|
ac7e186270 |
@@ -6,10 +6,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
--------------
|
--------------
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Fix return value of query scopes from parent class [#1366 / sforward](https://github.com/barryvdh/laravel-ide-helper/pull/1366)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- Add type to pivot when using a custom pivot class [#1518 / d3v2a](https://github.com/barryvdh/laravel-ide-helper/pull/1518)
|
||||||
|
|
||||||
2024-03-01, 3.0.0
|
2024-03-01, 3.0.0
|
||||||
------------------
|
------------------
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\MorphPivot;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||||
use Illuminate\Database\Schema\Builder;
|
use Illuminate\Database\Schema\Builder;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
use Illuminate\Filesystem\Filesystem;
|
||||||
@@ -614,7 +616,7 @@ class ModelsCommand extends Command
|
|||||||
$this->setProperty($name, null, null, true, $comment);
|
$this->setProperty($name, null, null, true, $comment);
|
||||||
}
|
}
|
||||||
} elseif (Str::startsWith($method, 'scope') && $method !== 'scopeQuery' && $method !== 'scope' && $method !== 'scopes') {
|
} elseif (Str::startsWith($method, 'scope') && $method !== 'scopeQuery' && $method !== 'scope' && $method !== 'scopes') {
|
||||||
//Magic set<name>Attribute
|
//Magic scope<name>Attribute
|
||||||
$name = Str::camel(substr($method, 5));
|
$name = Str::camel(substr($method, 5));
|
||||||
if (!empty($name)) {
|
if (!empty($name)) {
|
||||||
$comment = $this->getCommentFromDocBlock($reflection);
|
$comment = $this->getCommentFromDocBlock($reflection);
|
||||||
@@ -626,8 +628,8 @@ class ModelsCommand extends Command
|
|||||||
get_class($model->newModelQuery())
|
get_class($model->newModelQuery())
|
||||||
);
|
);
|
||||||
$modelName = $this->getClassNameInDestinationFile(
|
$modelName = $this->getClassNameInDestinationFile(
|
||||||
$reflection->getDeclaringClass(),
|
new ReflectionClass($model),
|
||||||
$reflection->getDeclaringClass()->getName()
|
get_class($model)
|
||||||
);
|
);
|
||||||
$this->setMethod($name, $builder . '|' . $modelName, $args, $comment);
|
$this->setMethod($name, $builder . '|' . $modelName, $args, $comment);
|
||||||
}
|
}
|
||||||
@@ -708,6 +710,17 @@ class ModelsCommand extends Command
|
|||||||
strpos(get_class($relationObj), 'Many') !== false
|
strpos(get_class($relationObj), 'Many') !== false
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
if ($relationObj instanceof BelongsToMany) {
|
||||||
|
$pivot = get_class($relationObj->newPivot());
|
||||||
|
if (!in_array($pivot, [Pivot::class, MorphPivot::class])) {
|
||||||
|
$this->setProperty(
|
||||||
|
$relationObj->getPivotAccessor(),
|
||||||
|
$this->getClassNameInDestinationFile($model, $pivot),
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
//Collection or array of models (because Collection is Arrayable)
|
//Collection or array of models (because Collection is Arrayable)
|
||||||
$relatedClass = '\\' . get_class($relationObj->getRelated());
|
$relatedClass = '\\' . get_class($relationObj->getRelated());
|
||||||
$collectionClass = $this->getCollectionClass($relatedClass);
|
$collectionClass = $this->getCollectionClass($relatedClass);
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models;
|
||||||
|
|
||||||
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots\CustomPivot;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ModelWithPivot extends Model
|
||||||
|
{
|
||||||
|
public function relationWithCustomPivot()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(ModelwithPivot::class)
|
||||||
|
->using(CustomPivot::class)
|
||||||
|
->as('customAccessor');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||||
|
|
||||||
|
class CustomPivot extends Pivot
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot;
|
||||||
|
|
||||||
|
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
||||||
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
||||||
|
|
||||||
|
class Test extends AbstractModelsCommand
|
||||||
|
{
|
||||||
|
public function test(): void
|
||||||
|
{
|
||||||
|
$command = $this->app->make(ModelsCommand::class);
|
||||||
|
|
||||||
|
$tester = $this->runCommand($command, [
|
||||||
|
'--write' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||||
|
$this->assertMatchesMockedSnapshot();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models;
|
||||||
|
|
||||||
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots\CustomPivot;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @property-read CustomPivot $customAccessor
|
||||||
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithCustomPivot
|
||||||
|
* @property-read int|null $relation_with_custom_pivot_count
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithPivot newModelQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithPivot newQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithPivot query()
|
||||||
|
* @mixin \Eloquent
|
||||||
|
*/
|
||||||
|
class ModelWithPivot extends Model
|
||||||
|
{
|
||||||
|
public function relationWithCustomPivot()
|
||||||
|
{
|
||||||
|
return $this->belongsToMany(ModelwithPivot::class)
|
||||||
|
->using(CustomPivot::class)
|
||||||
|
->as('customAccessor');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|CustomPivot newModelQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|CustomPivot newQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|CustomPivot query()
|
||||||
|
* @mixin \Eloquent
|
||||||
|
*/
|
||||||
|
class CustomPivot extends Pivot
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Models;
|
||||||
|
|
||||||
|
class Post extends PostParent
|
||||||
|
{
|
||||||
|
public function scopePublic($query)
|
||||||
|
{
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class PostParent extends Model
|
||||||
|
{
|
||||||
|
public function scopeActive($query)
|
||||||
|
{
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes;
|
||||||
|
|
||||||
|
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
||||||
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
||||||
|
|
||||||
|
class Test extends AbstractModelsCommand
|
||||||
|
{
|
||||||
|
public function test(): void
|
||||||
|
{
|
||||||
|
$command = $this->app->make(ModelsCommand::class);
|
||||||
|
|
||||||
|
$tester = $this->runCommand($command, [
|
||||||
|
'--write' => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||||
|
$this->assertMatchesMockedSnapshot();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Models;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property string|null $char_nullable
|
||||||
|
* @property string $char_not_nullable
|
||||||
|
* @property string|null $string_nullable
|
||||||
|
* @property string $string_not_nullable
|
||||||
|
* @property string|null $text_nullable
|
||||||
|
* @property string $text_not_nullable
|
||||||
|
* @property string|null $medium_text_nullable
|
||||||
|
* @property string $medium_text_not_nullable
|
||||||
|
* @property string|null $long_text_nullable
|
||||||
|
* @property string $long_text_not_nullable
|
||||||
|
* @property int|null $integer_nullable
|
||||||
|
* @property int $integer_not_nullable
|
||||||
|
* @property int|null $tiny_integer_nullable
|
||||||
|
* @property int $tiny_integer_not_nullable
|
||||||
|
* @property int|null $small_integer_nullable
|
||||||
|
* @property int $small_integer_not_nullable
|
||||||
|
* @property int|null $medium_integer_nullable
|
||||||
|
* @property int $medium_integer_not_nullable
|
||||||
|
* @property int|null $big_integer_nullable
|
||||||
|
* @property int $big_integer_not_nullable
|
||||||
|
* @property int|null $unsigned_integer_nullable
|
||||||
|
* @property int $unsigned_integer_not_nullable
|
||||||
|
* @property int|null $unsigned_tiny_integer_nullable
|
||||||
|
* @property int $unsigned_tiny_integer_not_nullable
|
||||||
|
* @property int|null $unsigned_small_integer_nullable
|
||||||
|
* @property int $unsigned_small_integer_not_nullable
|
||||||
|
* @property int|null $unsigned_medium_integer_nullable
|
||||||
|
* @property int $unsigned_medium_integer_not_nullable
|
||||||
|
* @property int|null $unsigned_big_integer_nullable
|
||||||
|
* @property int $unsigned_big_integer_not_nullable
|
||||||
|
* @property float|null $float_nullable
|
||||||
|
* @property float $float_not_nullable
|
||||||
|
* @property float|null $double_nullable
|
||||||
|
* @property float $double_not_nullable
|
||||||
|
* @property string|null $decimal_nullable
|
||||||
|
* @property string $decimal_not_nullable
|
||||||
|
* @property int|null $boolean_nullable
|
||||||
|
* @property int $boolean_not_nullable
|
||||||
|
* @property string|null $enum_nullable
|
||||||
|
* @property string $enum_not_nullable
|
||||||
|
* @property string|null $json_nullable
|
||||||
|
* @property string $json_not_nullable
|
||||||
|
* @property string|null $jsonb_nullable
|
||||||
|
* @property string $jsonb_not_nullable
|
||||||
|
* @property string|null $date_nullable
|
||||||
|
* @property string $date_not_nullable
|
||||||
|
* @property string|null $datetime_nullable
|
||||||
|
* @property string $datetime_not_nullable
|
||||||
|
* @property string|null $datetimetz_nullable
|
||||||
|
* @property string $datetimetz_not_nullable
|
||||||
|
* @property string|null $time_nullable
|
||||||
|
* @property string $time_not_nullable
|
||||||
|
* @property string|null $timetz_nullable
|
||||||
|
* @property string $timetz_not_nullable
|
||||||
|
* @property string|null $timestamp_nullable
|
||||||
|
* @property string $timestamp_not_nullable
|
||||||
|
* @property string|null $timestamptz_nullable
|
||||||
|
* @property string $timestamptz_not_nullable
|
||||||
|
* @property int|null $year_nullable
|
||||||
|
* @property int $year_not_nullable
|
||||||
|
* @property string|null $binary_nullable
|
||||||
|
* @property string $binary_not_nullable
|
||||||
|
* @property string|null $uuid_nullable
|
||||||
|
* @property string $uuid_not_nullable
|
||||||
|
* @property string|null $ipaddress_nullable
|
||||||
|
* @property string $ipaddress_not_nullable
|
||||||
|
* @property string|null $macaddress_nullable
|
||||||
|
* @property string $macaddress_not_nullable
|
||||||
|
* @property \Illuminate\Support\Carbon|null $created_at
|
||||||
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post active()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post public()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBinaryNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBinaryNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBooleanNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBooleanNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereCharNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereCharNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereCreatedAt($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDateNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDateNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDatetimeNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDatetimeNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDatetimetzNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDatetimetzNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDecimalNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDecimalNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDoubleNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereDoubleNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereEnumNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereEnumNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereFloatNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereFloatNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereId($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereIpaddressNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereIpaddressNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereJsonNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereJsonNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereJsonbNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereJsonbNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereLongTextNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereLongTextNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereMacaddressNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereMacaddressNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereMediumIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereMediumIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereMediumTextNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereMediumTextNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereSmallIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereSmallIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereStringNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereStringNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTextNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTextNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimeNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimeNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimestampNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimestampNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimestamptzNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimestamptzNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimetzNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTimetzNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTinyIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereTinyIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedBigIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedBigIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedMediumIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedMediumIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedSmallIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedSmallIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedTinyIntegerNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedTinyIntegerNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUpdatedAt($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
|
||||||
|
* @mixin \Eloquent
|
||||||
|
*/
|
||||||
|
class Post extends PostParent
|
||||||
|
{
|
||||||
|
public function scopePublic($query)
|
||||||
|
{
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|PostParent active()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|PostParent newModelQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|PostParent newQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder|PostParent query()
|
||||||
|
* @mixin \Eloquent
|
||||||
|
*/
|
||||||
|
class PostParent extends Model
|
||||||
|
{
|
||||||
|
public function scopeActive($query)
|
||||||
|
{
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user