-
-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: model-generation fix 3 errors #1058
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,21 @@ | |
namespace {{ $config->namespaces->model }}; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
@if($config->options->softDelete) {{ 'use Illuminate\Database\Eloquent\SoftDeletes;' }}@endif | ||
@if($config->options->tests or $config->options->factory) {{ 'use Illuminate\Database\Eloquent\Factories\HasFactory;' }}@endif | ||
|
||
@if(isset($swaggerDocs)){!! $swaggerDocs !!}@endif | ||
@if($config->options->softDelete) | ||
{{ 'use Illuminate\Database\Eloquent\SoftDeletes;' }} | ||
@endif | ||
@if($config->options->tests or $config->options->factory) | ||
{{ 'use Illuminate\Database\Eloquent\Factories\HasFactory;' }} | ||
@endif | ||
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
@if(isset($swaggerDocs)) | ||
{!! $swaggerDocs !!} | ||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure the presence of a new line between docs start and the last statement above. |
||
@else@nls(2)@endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure separation between class declaration and above use statements when there is no swagger docs. |
||
class {{ $config->modelNames->name }} extends Model | ||
{ | ||
@if($config->options->softDelete) {{ infy_tab().'use SoftDeletes;' }}@endif | ||
@if($config->options->tests or $config->options->factory){{ infy_tab().'use HasFactory;' }}@endif | ||
public $table = '{{ $config->tableName }}'; | ||
@if($config->options->softDelete && ($config->options->tests or $config->options->factory))@tab()use SoftDeletes, HasFactory;@nls(2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Combine |
||
@elseif($config->options->softDelete)@tab()use SoftDeletes;@nls(2) | ||
@elseif($config->options->tests or $config->options->factory)@tab()use HasFactory;@nls(2)@endif | ||
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace white space with a regular tab when inserting |
||
@tab()public $table = '{{ $config->tableName }}'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use @tab() instead of editor specific tab. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use @tab() instead of editor specific tab. |
||
|
||
@if($customPrimaryKey)@tab()protected $primaryKey = '{{ $customPrimaryKey }}';@nls(2)@endif | ||
@if($config->connection)@tab()protected $connection = '{{ $config->connection }}';@nls(2)@endif | ||
|
@@ -32,6 +38,5 @@ class {{ $config->modelNames->name }} extends Model | |
public static array $rules = [ | ||
{!! $rules !!} | ||
]; | ||
|
||
{!! $relations !!} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{
which manifests in an out-of-place space in the generated file.