Skip to content

Creating a module using php artisan twill:make:module and selecting no traits creates a malformed model #2731

Open
@phyce

Description

@phyce

Description

When using the interactive prompt and choosing all options as no (0), we get a malformed Model with an empty array "[]" in the place where traits would be added.

Steps to reproduce

php artisan twill:make:module Test
and pressing 0 for all prompts

Expected result

<?php

namespace App\Models;


use A17\Twill\Models\Model;

class Test extends Model 
{
    protected $fillable = [
        'published',
        'title',
        'description',
    ];
    
}

Actual result

<?php

namespace App\Models;


use A17\Twill\Models\Model;

class Test extends Model 
{
    []

    protected $fillable = [
        'published',
        'title',
        'description',
    ];
    
}

Versions

Twill 3.4.1
Laravel 11.41.3
PHP 8.2.27
MariaDB 11.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions