Skip to content

Commit

Permalink
Added back missing function
Browse files Browse the repository at this point in the history
Updated tests for upper case database column names
  • Loading branch information
jwhulette committed Nov 21, 2021
1 parent b8d6759 commit d095736
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 83 deletions.
2 changes: 1 addition & 1 deletion config/ide-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
|--------------------------------------------------------------------------
| Some databases, like Oracle return the column names in upper case
|
| For example, normally you would see this:
| For example, with Oracle normally you would see this:
|
| * @property \Illuminate\Support\Carbon $CREATED_AT
| * @property \Illuminate\Support\Carbon $UPDATED_AT
Expand Down
10 changes: 9 additions & 1 deletion src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public function getPropertiesFromTable($model)
foreach ($columns as $column) {
$name = $column->getName();

if ($this->hasLowerCaseProperties()) {
if ($this->hasLowerCaseModelProperties()) {
$name = Str::lower($name);
}

Expand Down Expand Up @@ -1051,6 +1051,14 @@ protected function getRelationTypes(): array
return array_merge(self::RELATION_TYPES, $configuredRelations);
}

/**
* @return bool
*/
protected function hasLowerCaseModelProperties()
{
return $this->laravel['config']->get('ide-helper.model_lower_case_properties', false);
}

/**
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models;
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocLower\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
class Upper extends Model
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models;
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocLower\Models;

use Illuminate\Database\Eloquent\Model;

/**
* Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models\Post
* Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocLower\Models\Upper
*
* @property integer $id
* @property string|null $char_nullable
Expand Down Expand Up @@ -82,84 +82,84 @@
* @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 newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @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 whereUnsignedDecimalNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUnsignedDecimalNullable($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)
* @method static \Illuminate\Database\Eloquent\Builder|Upper newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Upper newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Upper query()
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereBigIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereBinaryNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereBinaryNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereBooleanNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereBooleanNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereCharNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereCharNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDateNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDateNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDatetimeNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDatetimeNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDatetimetzNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDatetimetzNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDecimalNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDecimalNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDoubleNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereDoubleNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereEnumNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereEnumNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereFloatNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereFloatNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereIpaddressNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereIpaddressNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereJsonNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereJsonNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereJsonbNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereJsonbNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereLongTextNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereLongTextNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereMacaddressNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereMacaddressNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereMediumIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereMediumIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereMediumTextNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereMediumTextNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereSmallIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereSmallIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereStringNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereStringNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTextNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTextNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimeNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimeNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimestampNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimestampNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimestamptzNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimestamptzNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimetzNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTimetzNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTinyIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereTinyIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedBigIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedDecimalNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedDecimalNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedMediumIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedMediumIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedSmallIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedSmallIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedTinyIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUnsignedTinyIntegerNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUuidNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Upper whereYearNullable($value)
* @mixin \Eloquent
*/
class Post extends Model
class Upper extends Model
{
}
Loading

0 comments on commit d095736

Please sign in to comment.