mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c9b88f4b0 | ||
|
|
7345b1bff4 | ||
|
|
0fa3161af3 | ||
|
|
ee7b0cf6bd | ||
|
|
7cd11e292c |
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Validate Composer configuration
|
||||
run: composer validate --strict
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
|
||||
|
||||
# Drafts your next Release notes as Pull Requests are merged into "master"
|
||||
- uses: release-drafter/release-drafter@v7
|
||||
- uses: release-drafter/release-drafter@v6
|
||||
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
|
||||
# with:
|
||||
# config-name: my-config.yml
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: [8.5, 8.4, 8.3, 8.2]
|
||||
laravel: [12.x, 13.x]
|
||||
laravel: [11.x, 12.x, 13.x]
|
||||
exclude:
|
||||
- laravel: 13.x
|
||||
php: 8.2
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: src
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
git config --global core.eol lf
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.release.target_commitish }}
|
||||
|
||||
|
||||
@@ -1,38 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## v3.7.0 - 2026-03-17
|
||||
|
||||
### What's Changed
|
||||
|
||||
* Skip calling fake() when required parameters exist (Socialite compatibility) by @Jaspur in https://github.com/barryvdh/laravel-ide-helper/pull/1746
|
||||
* Make Soft Deleted Relationships Nullable by @evan-burrell in https://github.com/barryvdh/laravel-ide-helper/pull/1749
|
||||
* Support all DNF types from PHP RFC by @gurmanolog in https://github.com/barryvdh/laravel-ide-helper/pull/1751
|
||||
* Replace psalm with larastan by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1755
|
||||
* perf: reduce redundant lookups and file I/O in generation hot paths by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1757
|
||||
* fix: wrap bare intersection types in parentheses when adding nullable by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1756
|
||||
* feat(ModelsCommand): add configuration option to disable model query methods by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1692
|
||||
* ci: add PHP 8.5 to integration test matrix by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1760
|
||||
* chore: update test snapshots after merge order issue by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1762
|
||||
* Laravel 13.x Compatibility by @laravel-shift in https://github.com/barryvdh/laravel-ide-helper/pull/1763
|
||||
* fix: Correct indentation in camel case config comment block by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1767
|
||||
* fix: Place PHPDoc before class attributes when writing to models by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1765
|
||||
* fix: Don't extend root's parent class for facade stubs in helper file by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1766
|
||||
* Fix PHPDoc placement before PHP 8 class attributes and add regression tests by @Copilot in https://github.com/barryvdh/laravel-ide-helper/pull/1769
|
||||
* fix: Skip autoload exception when class existence is being checked by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1764
|
||||
* Remove closure in attribute test by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1772
|
||||
* Bump branch alias to 3.6 by @jnoordsij in https://github.com/barryvdh/laravel-ide-helper/pull/1774
|
||||
|
||||
### New Contributors
|
||||
|
||||
* @Jaspur made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1746
|
||||
* @evan-burrell made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1749
|
||||
* @gurmanolog made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1751
|
||||
* @laravel-shift made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1763
|
||||
* @isaackaara made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1767
|
||||
* @Copilot made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1769
|
||||
|
||||
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.6.1...v3.7.0
|
||||
|
||||
## v3.6.1 - 2025-12-10
|
||||
|
||||
### What's Changed
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.7-dev"
|
||||
"dev-master": "3.5-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
|
||||
+2
-7
@@ -101,12 +101,7 @@ class Alias
|
||||
}
|
||||
|
||||
if ($facade === '\Illuminate\Database\Eloquent\Model') {
|
||||
$this->usedMethods = [
|
||||
'decrement' => true,
|
||||
'decrementEach' => true,
|
||||
'increment' => true,
|
||||
'incrementEach' => true,
|
||||
];
|
||||
$this->usedMethods = ['decrement' => true, 'increment' => true];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +187,7 @@ class Alias
|
||||
public function shouldExtendParentClass()
|
||||
{
|
||||
return $this->parentClass
|
||||
&& !is_subclass_of($this->extends, Facade::class);
|
||||
&& $this->getExtendsNamespace() !== '\\Illuminate\\Support\\Facades';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -195,18 +195,6 @@ class MetaCommand extends Command
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't throw when class existence is being checked via class_exists(),
|
||||
// interface_exists(), trait_exists(), or enum_exists(). These functions
|
||||
// expect the autoloader to return gracefully when the class doesn't exist.
|
||||
// Throwing here would break libraries that use class_exists() to check for
|
||||
// optional dependencies (e.g. Doctrine ORM checking for removed classes).
|
||||
$existsFunctions = ['class_exists', 'interface_exists', 'trait_exists', 'enum_exists'];
|
||||
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3) as $frame) {
|
||||
if (isset($frame['function']) && in_array($frame['function'], $existsFunctions, true)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
throw new \ReflectionException("Class '$class' not found.");
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Arr;
|
||||
@@ -944,55 +943,13 @@ class ModelsCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
$this->relatedModelUsesSoftDeletes($relationObj)
|
||||
&& !$this->relationIncludesNonTrashedParents($relationObj)
|
||||
) {
|
||||
if ($this->relatedModelUsesSoftDeletes($relationObj)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the relation explicitly opts into returning non-soft-deleted parents
|
||||
* via ->withTrashed(), in which case the SoftDeletes-based nullability no longer applies.
|
||||
*
|
||||
* Returns false for ->onlyTrashed() and ->withoutTrashed(), which still leave the
|
||||
* relation potentially empty depending on the parent's soft-delete state.
|
||||
*
|
||||
* @param Relation $relationObj
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function relationIncludesNonTrashedParents(Relation $relationObj): bool
|
||||
{
|
||||
$query = $relationObj->getQuery();
|
||||
|
||||
if (!in_array(SoftDeletingScope::class, $query->removedScopes(), true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$relatedModel = $relationObj->getRelated();
|
||||
|
||||
if (!method_exists($relatedModel, 'getQualifiedDeletedAtColumn')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$deletedAtColumn = $relatedModel->getQualifiedDeletedAtColumn();
|
||||
|
||||
foreach ($query->getQuery()->wheres ?? [] as $where) {
|
||||
if (
|
||||
($where['column'] ?? null) === $deletedAtColumn
|
||||
&& in_array($where['type'] ?? null, ['Null', 'NotNull'], true)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the related model uses the SoftDeletes trait
|
||||
*
|
||||
|
||||
@@ -76,8 +76,6 @@ class Method
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$this->removePhpDocParamTagsForOptionalParameters();
|
||||
|
||||
//Get the parameters, including formatted default values
|
||||
$this->getParameters($method);
|
||||
|
||||
@@ -250,50 +248,6 @@ class Method
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove @param tags for optional reflection parameters so generated stubs match arity
|
||||
* checks in static analysis (optional params still appear in the PHP signature).
|
||||
*/
|
||||
protected function removePhpDocParamTagsForOptionalParameters(): void
|
||||
{
|
||||
if (!$this->method instanceof \ReflectionMethod) {
|
||||
return;
|
||||
}
|
||||
|
||||
$declaring = $this->method->getDeclaringClass()->getName();
|
||||
if (
|
||||
$declaring !== \Illuminate\Database\Query\Builder::class
|
||||
&& $declaring !== \Illuminate\Database\Eloquent\Builder::class
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->method->getParameters() as $param) {
|
||||
if (!$param->isOptional() || $param->isVariadic()) {
|
||||
continue;
|
||||
}
|
||||
if (!$param->isDefaultValueAvailable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$default = $param->getDefaultValue();
|
||||
// Keep @param for null/array defaults (nullable and list defaults stay documented).
|
||||
// Strip only non-null scalars (e.g. $boolean = 'and', $not = false) so tools that
|
||||
// count @param tags do not report false "missing argument" errors on shortened calls.
|
||||
if ($default === null || is_array($default) || !is_scalar($default)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$varName = '$' . $param->getName();
|
||||
$paramTags = $this->phpdoc->getTagsByName('param');
|
||||
foreach (array_values($paramTags) as $tag) {
|
||||
if ($tag instanceof ParamTag && $tag->getVariableName() === $varName) {
|
||||
$this->phpdoc->deleteTag($tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the parameters
|
||||
*
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PhpAttributesClosureInAttribute\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// Tests: closure expression inside an attribute argument (PHP 8.5+)
|
||||
#[SomeClosureAttr(fn () => true)]
|
||||
class ClosureInAttribute extends Model
|
||||
{
|
||||
protected $table = 'simples';
|
||||
}
|
||||
+4
-2
@@ -2,13 +2,16 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\UniqueColumn;
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PhpAttributesClosureInAttribute;
|
||||
|
||||
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
||||
|
||||
class Test extends AbstractModelsCommand
|
||||
{
|
||||
/**
|
||||
* @requires PHP 8.5
|
||||
*/
|
||||
public function test(): void
|
||||
{
|
||||
$command = $this->app->make(ModelsCommand::class);
|
||||
@@ -19,7 +22,6 @@ class Test extends AbstractModelsCommand
|
||||
|
||||
$this->assertSame(0, $tester->getStatusCode());
|
||||
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||
|
||||
$this->assertMatchesMockedSnapshot();
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PhpAttributesClosureInAttribute\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// Tests: closure expression inside an attribute argument (PHP 8.5+)
|
||||
/**
|
||||
* @property int $id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ClosureInAttribute newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ClosureInAttribute newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ClosureInAttribute query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ClosureInAttribute whereId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
#[SomeClosureAttr(fn() => true)]
|
||||
class ClosureInAttribute extends Model
|
||||
{
|
||||
protected $table = 'simples';
|
||||
}
|
||||
@@ -17,21 +17,6 @@ class ModelWithRelations extends Model
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id');
|
||||
}
|
||||
|
||||
public function softDeletableWithTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->withTrashed();
|
||||
}
|
||||
|
||||
public function softDeletableOnlyTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->onlyTrashed();
|
||||
}
|
||||
|
||||
public function softDeletableWithoutTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->withoutTrashed();
|
||||
}
|
||||
|
||||
public function nonSoftDeletable(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(NonSoftDeletableModel::class, 'non_soft_deletable_model_id');
|
||||
|
||||
-18
@@ -16,9 +16,6 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\NonSoftDeletableModel|null $nonSoftDeletableHasOne
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel $softDeletable
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel|null $softDeletableHasOne
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel $softDeletableOnlyTrashed
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel $softDeletableWithTrashed
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel $softDeletableWithoutTrashed
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithRelations newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithRelations newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithRelations query()
|
||||
@@ -36,21 +33,6 @@ class ModelWithRelations extends Model
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id');
|
||||
}
|
||||
|
||||
public function softDeletableWithTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->withTrashed();
|
||||
}
|
||||
|
||||
public function softDeletableOnlyTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->onlyTrashed();
|
||||
}
|
||||
|
||||
public function softDeletableWithoutTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->withoutTrashed();
|
||||
}
|
||||
|
||||
public function nonSoftDeletable(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(NonSoftDeletableModel::class, 'non_soft_deletable_model_id');
|
||||
|
||||
@@ -16,9 +16,6 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\NonSoftDeletableModel|null $nonSoftDeletableHasOne
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel|null $softDeletable
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel|null $softDeletableHasOne
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel|null $softDeletableOnlyTrashed
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel $softDeletableWithTrashed
|
||||
* @property-read \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletesRelations\Models\SoftDeletableModel|null $softDeletableWithoutTrashed
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithRelations newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithRelations newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithRelations query()
|
||||
@@ -36,21 +33,6 @@ class ModelWithRelations extends Model
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id');
|
||||
}
|
||||
|
||||
public function softDeletableWithTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->withTrashed();
|
||||
}
|
||||
|
||||
public function softDeletableOnlyTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->onlyTrashed();
|
||||
}
|
||||
|
||||
public function softDeletableWithoutTrashed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SoftDeletableModel::class, 'soft_deletable_model_id')->withoutTrashed();
|
||||
}
|
||||
|
||||
public function nonSoftDeletable(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(NonSoftDeletableModel::class, 'non_soft_deletable_model_id');
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\UniqueColumn\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class User extends Model
|
||||
{
|
||||
protected $table = 'users_unique';
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\UniqueColumn\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User wherePassword($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class User extends Model
|
||||
{
|
||||
protected $table = 'users_unique';
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class UsersUniqueTable extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('users_unique', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->string('password');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -101,6 +101,7 @@ DOC;
|
||||
* @param (\Closure(static): mixed)|string|array|\Illuminate\Contracts\Database\Query\Expression $column
|
||||
* @param mixed $operator
|
||||
* @param mixed $value
|
||||
* @param string $boolean
|
||||
* @return \Illuminate\Database\Eloquent\Builder<static>
|
||||
* @static
|
||||
*/
|
||||
@@ -129,6 +130,8 @@ DOC;
|
||||
* Add a "where null" clause to the query.
|
||||
*
|
||||
* @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns
|
||||
* @param string $boolean
|
||||
* @param bool $not
|
||||
* @return \Illuminate\Database\Eloquent\Builder<static>
|
||||
* @static
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user