Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Generators/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ protected function buildRelationships(Model $model)

$phpDoc = str_replace('{{ namespacedReturnClass }}', '\Illuminate\Database\Eloquent\Relations\\' . Str::ucfirst($type), $commentTemplate);

$methods .= PHP_EOL . $phpDoc . $method;
$methods .= $phpDoc . $method. PHP_EOL;
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/alias-relationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Salesman extends Model
'id' => 'integer',
];


public function lead()
{
return $this->hasOne(\App\User::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/certificate-pascal-case-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Certificate extends Model
'expiry_date' => 'date',
];


public function certificateType()
{
return $this->belongsTo(\App\CertificateType::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class CertificateType extends Model
'id' => 'integer',
];


public function certificates()
{
return $this->hasMany(\App\Certificate::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/custom-pivot-table-name.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class User extends Model
'id' => 'integer',
];


public function accounts()
{
return $this->belongsToMany(\App\Account::class, 'test');
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/foreign-key-shorthand-phpdoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Comment extends Model
'ccid' => 'integer',
];


/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/image-polymorphic-relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Image extends Model
'id' => 'integer',
];


public function imageable()
{
return $this->morphTo();
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/model-configured.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Comment extends Model
'author_id' => 'integer',
];


public function post()
{
return $this->belongsTo(\Some\App\Models\Post::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Flag extends Model
'user_id' => 'integer',
];


public function stars()
{
return $this->morphOne(\Other\Package\Order::class, 'starable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Recurrency extends Model
'user_id' => 'integer',
];


public function teams()
{
return $this->belongsToMany(\Some\Package\Team::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/model-relationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Subscription extends Model
'user_id' => 'integer',
];


public function teams()
{
return $this->belongsToMany(\App\Team::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/nested-models.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ScreeningQuestion extends Model
'question_type_id' => 'integer',
];


public function report()
{
return $this->belongsTo(\App\Models\Screening\Report::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/post-polymorphic-relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Post extends Model
'id' => 'integer',
];


public function images()
{
return $this->morphMany(\App\Image::class, 'imageable');
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/readme-example-phpdoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class Post extends Model
'author_id' => 'integer',
];


/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/readme-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Post extends Model
'author_id' => 'integer',
];


public function author()
{
return $this->belongsTo(\App\User::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/relationships-phpdoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Comment extends Model
'author_id' => 'integer',
];


/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/relationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Comment extends Model
'author_id' => 'integer',
];


public function post()
{
return $this->belongsTo(\App\Post::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/return-type-declarations.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class Term extends Model
'published' => 'boolean',
];


public function organizers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(\App\Organizer::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/soft-deletes-phpdoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Comment extends Model
'post_id' => 'integer',
];


/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/soft-deletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Comment extends Model
'post_id' => 'integer',
];


public function post()
{
return $this->belongsTo(\App\Post::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/unconventional.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Team extends Model
'options' => 'array',
];


public function owner()
{
return $this->belongsTo(\App\Owner::class);
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/models/user-polymorphic-relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class User extends Model
'id' => 'integer',
];


public function images()
{
return $this->morphMany(\App\Image::class, 'imageable');
Expand Down