diff --git a/views/model/model.blade.php b/views/model/model.blade.php index dab7fef64..9b63cb051 100755 --- a/views/model/model.blade.php +++ b/views/model/model.blade.php @@ -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 +@if(isset($swaggerDocs)) +{!! $swaggerDocs !!} +@else@nls(2)@endif 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) +@elseif($config->options->softDelete)@tab()use SoftDeletes;@nls(2) +@elseif($config->options->tests or $config->options->factory)@tab()use HasFactory;@nls(2)@endif +@tab()public $table = '{{ $config->tableName }}'; @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 !!} }