https://twill.io logo
Join Discord
Powered by
# ❓questions
  • i

    ifox

    03/10/2023, 2:18 PM
    you may still need a custom order, I'd have to check
  • n

    Nechalon

    03/10/2023, 2:19 PM
    oh, and then it would be sortable or we would still need to override the order function in the repo?
  • i

    ifox

    03/10/2023, 2:20 PM
    oops edited the wrong message, answer above
  • n

    Nechalon

    03/10/2023, 2:31 PM
    okay, now I have added the
    getUserNameAttribute
    and
    getUserEmailAttribute
    functions and set up the relation correctly (I believe), now it shows the columns on the table row, but cant sort it yet
  • n

    Nechalon

    03/10/2023, 2:39 PM
    how should I overwrite the order function?
    i
    • 2
    • 4
  • j

    jefsev

    03/10/2023, 3:05 PM
    Hi is there a twill artisan command to add a controller to an existing capsule in my projecT?
  • i

    ifox

    03/10/2023, 3:58 PM
    a twill controller?
  • i

    ifox

    03/10/2023, 3:58 PM
    how do you have a capsule without a controller?
  • a

    AntonyPL

    03/10/2023, 4:18 PM
    Hi, it's all good now. My apps - i don't know - catch a huge cache.. Thank you for and @Harings Rob and @ifox for a supporting 🙂
    • 1
    • 1
  • s

    sathish

    03/11/2023, 10:46 AM
    Hi, Do you have any idea about css clip path?
  • i

    ifox

    03/11/2023, 10:47 AM
    hi @sathish Twill's discord doesn't seem like the right place to ask about this. Feel free to ask this in #811986414152450108, since #811986149064441927 is for Twill's questions
  • a

    AntonyPL

    03/11/2023, 4:43 PM
    Hi! How save input text (with translation) in json column? It isn’t browser fields, i need save a few input text in json column
  • i

    ifox

    03/11/2023, 4:54 PM
    https://twill.io/docs/form-fields/field-grouping.html
  • a

    AntonyPL

    03/11/2023, 4:56 PM
    Thank you 🙂
  • a

    AntonyPL

    03/11/2023, 5:03 PM
    @ifox and a last small question: when can we expected stable release twill cms for Laravel 10 (2.x or 3.x) ?
  • a

    AntonyPL

    03/12/2023, 6:44 PM
    Hey there - let's talk about prefix in input - i think, prefix should be save in db OR more flexible to make a finally decision [save or no save]. For example, in my case, url should be save a fullpath (with prefix) not only value.
  • a

    AntonyPL

    03/12/2023, 8:46 PM
    And another question - how [for example: https://github.com/cwsdigital/twill-capsule-menus/tree/main/Models] prepare another models and migrations in created Capsules via twills command ? It's possible, or i need create another capsules and merged into created Capsules ?
  • m

    MD

    03/13/2023, 2:30 AM
    you're in control of the prefix so you can decide whether to populate in
    prepareFieldsBeforeSave()
    of your repository so it saves to the database (and conversely to strip it out in
    getFormFields()
    ) or to add it everywhere it's used with something like a model attribute
  • m

    MD

    03/13/2023, 2:31 AM
    so you've already got the flexibility you're after 🙂
  • m

    MD

    03/13/2023, 2:31 AM
    Twill's commands are just stubs so you can just go and edit the generated files however you want
  • n

    Nechalon

    03/13/2023, 10:42 AM
    Hello, @ifox the function example you sent a few days ago, is giving
    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user.name' in 'order clause'
    error when clicking on the name to order it.
    Copy code
    public function order($query, array $orders = [])
        {
            if (array_key_exists('user_name', $orders)) {
                $direction = $orders['user_name'];
    
                unset($orders['user_name']);
    
                $query->with('user')->orderBy('user.name');
            }
    
            return parent::order($query, $orders);
        }
    Its complaining about the
    user.name
    field, I have tried
    user_name
    and
    name
    there, but its the same. The
    $indexColumns
    array looks like this
    Copy code
    'Name' => [
                'title' => 'Name',
                'field' => 'user_name',
                'sort' => true,
            ],
  • i

    ifox

    03/13/2023, 10:46 AM
    Hi @Nechalon I'm not in front of your codebase so I can't guarantee that my snippets will work for you. You may need a join. This is standard Laravel Eloquent, you should research how to order by a belongsTo relationship.
  • i

    ifox

    03/13/2023, 10:46 AM
    as soon as possible this month
  • e

    Edex

    03/13/2023, 12:12 PM
    Hi! Is there a way to use the connected-browser-field feature, but with 2 select fields?
  • n

    Nechalon

    03/13/2023, 12:21 PM
    How can I format the data on indexColumns to be different than the stored data? If I use getColumnAttribute() functions, then it will display the formatted version everywhere
  • i

    ifox

    03/13/2023, 12:22 PM
    Use a dedicated accessor for your index column
  • i

    ifox

    03/13/2023, 12:23 PM
    Hi @Edex not at the moment but that should be possible to implement
  • n

    Nechalon

    03/13/2023, 12:25 PM
    Where can I find the documentation about that in twill?
  • i

    ifox

    03/13/2023, 12:27 PM
    This is not a twill specific feature, this is standard Laravel. You can use an accessor like:
    getColumnInTwillIndexAttribute()
    and in your indexColumns use
    column_in_twill_index
  • n

    Nechalon

    03/13/2023, 12:28 PM
    oh, so its the exact same thing just use a different function name from the original column name, so it wouldnt use it everywhere, got it
1...477478479...484Latest